6

Entity Framework references some DLLs. On one system, they showed up in the GAC which is very convenient. I can't figure out how I did this. The installer doesn't seem to do this --

The dlls I'm specifically talking about here are:

  • The core library assembly Microsoft.Practices.EnterpriseLibrary.Common.dll
  • The Unity Application Block assembly Microsoft.Practices.Unity.dll
  • The Object Builder assembly Microsoft.Practices.ObjectBuilder2.dll

but I guess it applies to any dll one might want to add to the GAC. Also is there a way to check on program startup whether an assembly even is in the GAC?

Matt
  • 25,943
  • 66
  • 198
  • 303

1 Answers1

3

Check if is in the GAC:

bool inGac = System.Reflection.Assembly.Load(assemblyName).GlobalAssemblyGac;

To install in gac, there's a question Methods to programmatically install a .NET assembly into the GAC

Community
  • 1
  • 1
onof
  • 17,167
  • 7
  • 49
  • 85
  • You probably mean the GlobalAssemblyCache property - https://msdn.microsoft.com/en-us/library/system.reflection.assembly.globalassemblycache(v=vs.110).aspx – JJS Aug 21 '15 at 17:57