Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio reference x64 GAC

How can one get Visual Studio 2005/2008 to reference assemblies in the 64-bit GAC instead of the 32-bit GAC? We are settin the target platfom to x64 and the compiler is throwing the error of

Error 2 Warning as Error: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor Common

Error 3 Warning as Error: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor Common

Error 4 Assembly signing failed; output may not be signed -- The system cannot find the file specified. Common


Update 29 Dec 08

Been trying out Aaron Stebner's suggestions to place 64-bit assemblies onto an isolated location (e.g. C:\Windows\Microsoft.NET\Framework64\v2.0.50727\GAC_64) and creating additional entries in the registry like HKLM\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\GAC_64 or HKLM\SOFTWARE\Microsoft.NETFramework\v2.0.50727\AssemblyFoldersEx\GAC_64 but Visual Studio 2005 is still not picking it up....

like image 297
icelava Avatar asked Oct 22 '08 07:10

icelava


People also ask

What is GAC in Visual Studio?

The Global Assembly Cache stores assemblies specifically designated to be shared by several applications on the computer.


1 Answers

I'm not sure why you would need to do this. .NET code that isn't specifically compiled for 32 bit will run 64 bit if it can. This includes the base framework libraries. In short, there is no reason that I know of to compile your assemblies specifically for 64 bit (other than referencing unmanaged 64 bit dlls, but you're talking about the GAC).

Some more information might help here.

like image 91
sliderhouserules Avatar answered Oct 19 '22 21:10

sliderhouserules