开发者

How to show a reference of the shared assembly in the .net add reference dialog window?

Q:

I make a dll and put it in the global assembly cache (GAC),now i wanna to use this dll in my application , but i can't see any reference to it. When Add reference ----> dialog window --->no reference to my shared assembly .i don't see any reference .

how to fix this problem.

to make my shared assembly , i do the following:

1-Right click on my project file ---> properties --->Signing tab ---> choose a strong name.

2- In the AssemblyInfo.cs file add this line

[assembly: AssemblyKeyFile("C:\\Users\\just_name\\Downloads\\New folder\\testingGAC\\testingGAC\\key.snk")] then build the solution.

3- Drag the 开发者_开发百科testingGAC.dll file into the assembly folder in my c:\

Is there any problems with these steps.

Thanks in advance.


The list of referenes doesn't actually work off the GAC - there's a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders that controls which folders get looked at when creating this list.

This link has the full low-down on the process


You need to register your assembly to the GAC thus:

gacutil /i AssemblyFileName.dll

You can remove it from the GAC thus:

gacutil /u AssemblyFileName.dll


You need to install the assembly in the GAC folder using the Global Assembly Cache Tool (Gacutil.exe)

Next install/register the assembly, then follow these steps to add reference:

Expand the project and then right-click on the References item. Select "Add Reference" from the popup menu, and the Add Reference dialog box is displayed.

To refer an assembly in the GAC, just click on the Browse button and browse to the directory (myGAC/bin/debug) that contains the assembly (myGAC.dll). Locate the assembly, select it, and click OK.

Check this article for details: How do I create shared assemblies ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜