Drag and drop a DLL to the GAC (“assembly”) in windows server 2008 .net 4.0

In .net 4.0 Microsoft removed the ability to add DLLs to the Assembly simply by dragging and dropping. Instead you need to use gacutil.exe, or create an installer to do it. Microsoft actually doesn’t recommend using gacutil, but I went that route anyway. To use gacutil on a development machine go to: Start -> programs … Read more

GAC 32bit vs. 64bit

The gacutil.exe should install the .dll to the right location depending on how it was compiled. You should be able to find the file here : %ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\ .NET 4 has it’s own Assembly folder (c:\windows\Microsoft.NET\assembly) which has a \GAC_32 and \GAC_64 directories within… This is where you will find your files once … Read more

How to prevent a .NET application from loading/referencing an assembly from the GAC?

If both assemblies are strong-named (signed), the CLR will always load from the GAC. Here are the steps the runtime uses to resolve assembly references (from How the Runtime Locates Assemblies): Determines the correct assembly version by examining applicable configuration files, including the application configuration file, publisher policy file, and machine configuration file. If the … Read more

How can I force .NET to use a local copy of an assembly that’s in the GAC

Make sure the GAC Assembly and local Assembly have different version numbers (not a bad idea to let your build number, at least, auto-increment by wild-carding your AssemblyVersion in AssemblyInfo: [assembly: AssemblyVersion(“1.0.0.*”)] ). Then, redirect your assembly binding using your app’s config: http://msdn.microsoft.com/en-us/library/2fc472t2(VS.80).aspx http://msdn.microsoft.com/en-us/library/433ysdt1(VS.80).aspx. In your case, you won’t need the “appliesTo” attribute of the … Read more

Is there any GAC equivalent for .NET Core?

Edit 2017-09-01 Somewhat analogous to the GAC, .NET Core 2.0 introduces the “Runtime package store”: Starting with .NET Core 2.0, it’s possible to package and deploy apps against a known set of packages that exist in the target environment. The benefits are faster deployments, lower disk space use, and improved startup performance in some cases. … Read more