Failed to add GAC assembly in the Add Link dialog box.

I have an Interop build in the GAC; Windows Explorer clearly shows that it is listed in the folder C:\WINDOWS\assembly. However, when I try to add a link to it in Visual Studio, I do not see it anywhere in the Add Link dialog box.

If this happened to you, what is the reason for this? And how to fix it?

(the assembly is actually in the folder C:\WINDOWS\assembly\GAC_MSILif you need to know.)

+5
source share
7 answers

Add one of the following registry keys where the directory to search is located, and MyAssemblies is the category of your assemblies. Note. HKCU is for the current user, and HKLM is for everyone on the same computer.

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"
+5
source

I created a tool that will help you achieve your goal. Muse VSReferences will allow you to add a global assembly caching link to the project from Add GAC Link.

+3
source

, GAC , " ". MSDN . . " " ".

+2

"C:\WINDOWS\assembly" - , Windows ( ) .

, "C:\Windows\assembly\GAC_MSIL..... dll" VS.NET.

0

GAC , GAC .

Manual with MZ-Tools

0
source

As an alternative, I edited the project file and manually added the link.

  • Install the assembly in the GAC. gacutil /i "Foo.dll"
  • Find a strong build name. gacutil /lwill provide you with a list from which you can choose.
  • In the consumption project file, add the following line (from the previous step)
  • <Reference Include="Foo, Version=x.x, Culture=neutral, PublicKeyToken=xxx, processorArchitecture=MSIL" />
  • And it works. :)
0
source

Use this command on the command line of Visual Studio

regsvr32 / u shfusion.dll

-1
source

All Articles