Enable dll in GAC?

This may be a bit of a dumb question, but I need some clarification. I am a little new to .NET and created an EXE that was supposed to reference an existing COM-DLL. At the same time, Visual Studio 2010 automatically created the "Interop" DLL, which they need / use to work with the outdated COM library.

I deployed my project and included this Interop DLL (in the same folder), and everything works fine. However, I have other applications that will need to use the same legacy COM-DLL. Is it possible to refer to them the same way in every application and continue to deploy the Interop DLL with each application? Unfortunately, all of these small applications are in the same folder, and each of them uses the same Interop DLL (therefore, it already exists there if it is used by another application). I have to have them in the same folder, because these applications are called as a way to configure the parent application. As such, it only scans the local folder when it wants to launch a “regular” application. It just bothers me if one of the exe is ever removed and they take out the Interop dll,then the rest, who are still dependent on him, will fail.

So, I was wondering if it is possible or a good idea to put this Interop DLL in the GAC? I went ahead and installed the Interop DLL in the GAC, and then deleted the Interop DLL from the folder where the EXE works, and it did not work. I get the error "Could not load file or assembly." I am stuck for this to work.

  • Do I need to reference the Interop DLL in my project differently, so now this is from the GAC? or
  • Do I need to add something to my .NET code, such as Assembly.Load, for it to work?
  • Do I need to create this Interop DLL myself using TLBIMP?

Any help would be greatly appreciated!

Regards,

Nelson

+5
source share
2 answers

PIA, "Primary Interop Assembly". /primary Tlbimp.exe, <.pdf >

PIA, , , interop. , . , VS2010 " ", , .

. , GAC, . , , Fuslogvw.exe .

+1

ILmerge, DLL GAC.

PS. VS.NET 2010, Embed Interop types, .

0

All Articles