C# – VisualStudio C# x64, why AddReference option, .NET tab points to x86 DLL instead of x64

64-bitcvisual-studio-2008windows-server-2008

I want to create an x64 application.

When I want to add a reference for example to system.data in window AddReference under tab .NET I see only x86 DLLs, and I need 64 bit versions.

I have Windows Server 2008 x64 with Visual Studio 2008.

I created a project and I set x64 under Configuration Manager.

What can I do to force Visual Studio to point to the
correct DLLs (from C:\WINDOWS\Microsoft.NET\Framework64 instead
of C:\WINDOWS\Microsoft.NET\Framework)?

Best Answer

Running into the same problem, and yes I also consider it a bug from MS. You'd think either the x64 or x86 sgen.exe could handle msil assemblies, especially when you have to reference framework assemblies.

I would prefer building msil assemblies myself, but have a native-built 3rd party assembly tossed into my mix. When the project tries to generate the serialization assemblies using the x86 sgen.exe, it complains that the 3rd party assembly is "the wrong format."

When I use the x64 sgen.exe, it complains that System.Data is "the wrong format". But I don't have the option of pointing at the Framework64 version in the .csproj file.