Home All Groups Group Topic Archive Search About

Exposing Com Interfaces of a .Net Class Library (Trouble Regsvr32)

Author
29 Nov 2006 2:21 PM
GB
I have created a .Net Class (Component), which uses also references pure .Net
assmblies.  I use this component as an interface to the .Net Class, and call
the Component in a "classic asp" page. All of this works fine locally,
however when I try to set this dll up (register) on another computer I get
the following "name.dll was loaeded, but the DllRegisterServer entry point
was not found... DllRegisterServer may not be exported, or a corrupt version
of name.dll may be in memory. Consider using PView to detect and remove it"

Any ideas? I need to be able to use this Dll from our web host, i.e. I need
to be able to install it on our web host.

Please, any help would be appreciated.
Thanks

Author
29 Nov 2006 2:33 PM
Michel Posseth [MCP]
Well asuming you have met the requirments for a Com visible and capable class

Did you register the dll with Ragasm.exe ???? as .Net Com assembly`s  must
be registred with this tool instead of regsvr32.exe


regards

Michel Posseth [MCP]



Show quoteHide quote
"GB" wrote:

> I have created a .Net Class (Component), which uses also references pure .Net
> assmblies.  I use this component as an interface to the .Net Class, and call
> the Component in a "classic asp" page. All of this works fine locally,
> however when I try to set this dll up (register) on another computer I get
> the following "name.dll was loaeded, but the DllRegisterServer entry point
> was not found... DllRegisterServer may not be exported, or a corrupt version
> of name.dll may be in memory. Consider using PView to detect and remove it"
>
> Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> to be able to install it on our web host.
>
> Please, any help would be appreciated.
> Thanks
Author
29 Nov 2006 4:58 PM
GB
1 step closer...
Here is my setup
1. Create a new Class Library Project
2. Delete the Class1.vb
3. Add new compoent item "ComponentName" as
4. Add my methods etc.
5. Compile
6. Goto .Net Command Tool, run RegASM /tlb CompoentName.dll (also tried
without tlb)...
7. Create ASp page, with the following
   Set myObj = Server.CreateObject("CompoentName.CompoentDefinition")

This does not work, and produces the following in the browser: "Error Type:
(0x80070002)"
HOwever, once I go back to my project and do the following and rebuild it
works:
Configuration Properties >> Build >> Register for COM Interop

However, once I wish to copy the dll's to the server and register, I again,
get the same error....
Ideas? Thoughts?


Show quoteHide quote
"Michel Posseth [MCP]" wrote:

>
> Well asuming you have met the requirments for a Com visible and capable class
>
> Did you register the dll with Ragasm.exe ???? as .Net Com assembly`s  must
> be registred with this tool instead of regsvr32.exe
>
>
> regards
>
> Michel Posseth [MCP]
>
>
>
> "GB" wrote:
>
> > I have created a .Net Class (Component), which uses also references pure .Net
> > assmblies.  I use this component as an interface to the .Net Class, and call
> > the Component in a "classic asp" page. All of this works fine locally,
> > however when I try to set this dll up (register) on another computer I get
> > the following "name.dll was loaeded, but the DllRegisterServer entry point
> > was not found... DllRegisterServer may not be exported, or a corrupt version
> > of name.dll may be in memory. Consider using PView to detect and remove it"
> >
> > Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> > to be able to install it on our web host.
> >
> > Please, any help would be appreciated.
> > Thanks
Author
30 Nov 2006 8:06 AM
Michel Posseth [MCP]
Well i prefer to use the technique described here
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/b9974554b8d68a52/ca996d74d250974e?lnk=st&q=michel+posseth+COM+VB.Net&rnum=28#ca996d74d250974e

this works in all VB.Net versions ( 2002 , 2003 and 2005 )

And works for me every time :-)


regards

Michel 




Show quoteHide quote
"GB" wrote:

> 1 step closer...
> Here is my setup
> 1. Create a new Class Library Project
> 2. Delete the Class1.vb
> 3. Add new compoent item "ComponentName" as
> 4. Add my methods etc.
> 5. Compile
> 6. Goto .Net Command Tool, run RegASM /tlb CompoentName.dll (also tried
> without tlb)...
> 7. Create ASp page, with the following
>    Set myObj = Server.CreateObject("CompoentName.CompoentDefinition")
>
> This does not work, and produces the following in the browser: "Error Type:
> (0x80070002)"
> HOwever, once I go back to my project and do the following and rebuild it
> works:
> Configuration Properties >> Build >> Register for COM Interop
>
> However, once I wish to copy the dll's to the server and register, I again,
> get the same error....
> Ideas? Thoughts?
>
>
> "Michel Posseth [MCP]" wrote:
>
> >
> > Well asuming you have met the requirments for a Com visible and capable class
> >
> > Did you register the dll with Ragasm.exe ???? as .Net Com assembly`s  must
> > be registred with this tool instead of regsvr32.exe
> >
> >
> > regards
> >
> > Michel Posseth [MCP]
> >
> >
> >
> > "GB" wrote:
> >
> > > I have created a .Net Class (Component), which uses also references pure .Net
> > > assmblies.  I use this component as an interface to the .Net Class, and call
> > > the Component in a "classic asp" page. All of this works fine locally,
> > > however when I try to set this dll up (register) on another computer I get
> > > the following "name.dll was loaeded, but the DllRegisterServer entry point
> > > was not found... DllRegisterServer may not be exported, or a corrupt version
> > > of name.dll may be in memory. Consider using PView to detect and remove it"
> > >
> > > Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> > > to be able to install it on our web host.
> > >
> > > Please, any help would be appreciated.
> > > Thanks
Author
30 Nov 2006 8:26 AM
Michel Posseth [MCP]
Well after rereading and my own comment in 2005  i guess you did not meet
this requirment 

#A creatable COM class must have a Public Sub New()
with no parameters, otherwise, the class will not be
registered in the COM registry and cannot be created
via CreateObject. #

regards

Michel 





Show quoteHide quote
"GB" wrote:
> 1 step closer...
> Here is my setup
> 1. Create a new Class Library Project
> 2. Delete the Class1.vb
> 3. Add new compoent item "ComponentName" as
> 4. Add my methods etc.
> 5. Compile
> 6. Goto .Net Command Tool, run RegASM /tlb CompoentName.dll (also tried
> without tlb)...
> 7. Create ASp page, with the following
>    Set myObj = Server.CreateObject("CompoentName.CompoentDefinition")
>
> This does not work, and produces the following in the browser: "Error Type:
> (0x80070002)"
> HOwever, once I go back to my project and do the following and rebuild it
> works:
> Configuration Properties >> Build >> Register for COM Interop
>
> However, once I wish to copy the dll's to the server and register, I again,
> get the same error....
> Ideas? Thoughts?
>
>
> "Michel Posseth [MCP]" wrote:
>
> >
> > Well asuming you have met the requirments for a Com visible and capable class
> >
> > Did you register the dll with Ragasm.exe ???? as .Net Com assembly`s  must
> > be registred with this tool instead of regsvr32.exe
> >
> >
> > regards
> >
> > Michel Posseth [MCP]
> >
> >
> >
> > "GB" wrote:
> >
> > > I have created a .Net Class (Component), which uses also references pure .Net
> > > assmblies.  I use this component as an interface to the .Net Class, and call
> > > the Component in a "classic asp" page. All of this works fine locally,
> > > however when I try to set this dll up (register) on another computer I get
> > > the following "name.dll was loaeded, but the DllRegisterServer entry point
> > > was not found... DllRegisterServer may not be exported, or a corrupt version
> > > of name.dll may be in memory. Consider using PView to detect and remove it"
> > >
> > > Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> > > to be able to install it on our web host.
> > >
> > > Please, any help would be appreciated.
> > > Thanks
Author
30 Nov 2006 4:40 PM
GB
Yeah it worked... I had to Strongly Name the assembly. and register in the
GAC afterwords... Just a few more questions.
1. Can you get away without Strongly Naming your Assumbly for this purpose?
I ask this question cause this assembly (Component) has a reference to
another assembly which is not strongly named...
2. Also, if I make changes to the component, how do I go about implement
them on the server after I recompile the project?
Is this correct (please fill gaps if their are any)
a) Make changes, recompilie
b) copy dll to the server (web server)
c) unregister old regasm /unregister component.dll tlb/ component.dll
d) reregister  regasm tlb/ component.dll

Is that it? Do I need to do anything in the GAC?

Thanks

Show quoteHide quote
"GB" wrote:

> I have created a .Net Class (Component), which uses also references pure .Net
> assmblies.  I use this component as an interface to the .Net Class, and call
> the Component in a "classic asp" page. All of this works fine locally,
> however when I try to set this dll up (register) on another computer I get
> the following "name.dll was loaeded, but the DllRegisterServer entry point
> was not found... DllRegisterServer may not be exported, or a corrupt version
> of name.dll may be in memory. Consider using PView to detect and remove it"
>
> Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> to be able to install it on our web host.
>
> Please, any help would be appreciated.
> Thanks
Author
30 Nov 2006 6:21 PM
Michel Posseth [MCP]
strange ,,

"GB" wrote:

> Yeah it worked... I had to Strongly Name the assembly. and register in the
> GAC afterwords... Just a few more questions.
> 1. Can you get away without Strongly Naming your Assumbly for this purpose?
> I ask this question cause this assembly (Component) has a reference to
> another assembly which is not strongly named...

i never needed to do so , my assembly`s are located in the app directory (
VB6 in my case )

> 2. Also, if I make changes to the component, how do I go about implement
> them on the server after I recompile the project?
> Is this correct (please fill gaps if their are any)
> a) Make changes, recompilie
> b) copy dll to the server (web server)
> c) unregister old regasm /unregister component.dll tlb/ component.dll
> d) reregister  regasm tlb/ component.dll
>
> Is that it? Do I need to do anything in the GAC?
>

If you use the aproach i showed ( the response with the link ) you can just
copy the new version and everything should be fine

Show quoteHide quote
> Thanks
>
> "GB" wrote:
>
> > I have created a .Net Class (Component), which uses also references pure .Net
> > assmblies.  I use this component as an interface to the .Net Class, and call
> > the Component in a "classic asp" page. All of this works fine locally,
> > however when I try to set this dll up (register) on another computer I get
> > the following "name.dll was loaeded, but the DllRegisterServer entry point
> > was not found... DllRegisterServer may not be exported, or a corrupt version
> > of name.dll may be in memory. Consider using PView to detect and remove it"
> >
> > Any ideas? I need to be able to use this Dll from our web host, i.e. I need
> > to be able to install it on our web host.
> >
> > Please, any help would be appreciated.
> > Thanks