How to register .NET Dlls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm trying to register my Dlls in the client machine without using any
deployment package. I tried copying all the files and Dlls to a specified
folder and run, but then the application crashes.
Do I have to use some tool like “regsvr32.exe†or “gacutil.exe†to
registry the Dlls in the client machine?

Thank you,
Roby Eisenbraun Martins
 
Yes, you can register them in the GAC. In order to do that you'll need to
have sign your assemblies (dlls), using key generated by sn.exe tool.
Then in the client machine you perfrm gacutil -i your.dll. Your assembly is
in the GAC, and anyone have access it using type name.
 
What do you mean by "register"? If you mean you've got some .NET COM
assemblies you'll have to run regasm or the equivalent on the target system.
Also, putting assemblies in the GAC is a deployment choice that you perhaps
don't need if your app is just an exe with some class libraries - that
wouldn't need the GAC unless you're sharing some assemblies with other apps
on the system.
 
I can generate a key file using sn.exe, but when I try to execute gacutul
I receive an error message asking for the "strong name". How can i tie the
dlls with the strong "name"?
 
In order to sign your assemly you can use assembly attributes, usually
defined in AssemblyInfo.cs.
The attributes will look like

[assembly: AssemblyKeyFile(@"C:\Snk\MyCustAssembly.snk")]
[assembly: AssemblyKeyName("MyCustAssembly")]

After build your assembly will be "signed" and can be placed in the GAC
 
OK, but I don't have the source code from all the dlls I am using. Some of
them are from another applications. I have only the DLL files.

Vadym Stetsyak said:
In order to sign your assemly you can use assembly attributes, usually
defined in AssemblyInfo.cs.
The attributes will look like

[assembly: AssemblyKeyFile(@"C:\Snk\MyCustAssembly.snk")]
[assembly: AssemblyKeyName("MyCustAssembly")]

After build your assembly will be "signed" and can be placed in the GAC

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Roby Eisenbraun Martins said:
I can generate a key file using sn.exe, but when I try to execute
gacutul
I receive an error message asking for the "strong name". How can i tie the
dlls with the strong "name"?
 
An error in the first code line executed. What I think is not the code at
all. Is just a way to .NET says it can't read all the components requerid.
 
Back
Top