There is a .Net project that compiles a Dll library when compiled.

And there are many other projects that use this library.

The problem is to maintain the current version of this library in all projects. It is difficult to track where some dll is used (from Debag or Release) + the path to Dll changes periodically (the library project and projects using it are in SVN and when downloading to another PC all links to the library have to be updated)

I wish that after compiling the Dll of the library it was registered in the system or in some other way became available for connection through the link manager VisualStudio (Project-> add link)

Setting the checkbox next to "Registration for COM interaction" (Project properties-> Assembly) solves the problem by 50%. Dll is added to the list of libraries on the COM tab in the link manager. But when you try to add a library to the project, it gives an exception.

Question: How to automatically register dll library after each assembly?

PS: I believe that you can achieve what you want by describing the studio what to do after a successful compilation (project properties-> build events), but I don’t know how to write there to achieve the desired, and I don’t even know how to correctly formulate the Google question.

  • "so that after compiling the Dll of the library it is registered in the system" - the dll (.net assembly) can be registered with the GAC. - Stack
  • @Stack: Understood with the registration and automation of this process during the assembly. But to add a link to this library you have to go to Windows \ Microsoft.NET \ assembly \ GAC_MSIL. Is it an option to add a registered library to one of the link manager directories? - Alexey
  • to install the assembly in the GAC there is gacutil - added to the answer. - Stack
  • @Stack: How to register assemblies using gacutil.exe I already figured out. Actually about this and wrote above. Windows \ Microsoft.NET \ assembly \ GAC_MSIL is the place where the assembly registered via gacutil.exe falls. - Alexey
  • if the assembly is in the GAC, then the full path to the assembly is not necessary. - Stack

1 answer 1

To share an assembly in multiple applications, it can be placed in the global assembly cache (GAC).
To register the assembly in the GAC, the Gacutil.exe utility (Global Assembly Cache Tool) is used.
On MSDN, see "Working with assemblies and the global assembly cache . "

In order for the assembly after installation in the GAC to become visible in the Visual Studion - Reference Manager, you need to add an entry to the registry

[HKCU\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\MyAssemblies] @="C:\\MyAssemblies" 

For more information, see the MSDN: dialog box .