Question

My development environment is Visual Studio 2010. I'm using managed code in my C++ project, compiling with /CLI flag and adding /FU with .NET DLLs.

When I'm compiling with 32-bit target machine everything goes right, but when compiling to 64-bit, it seems that the compiler still uses the x86 .NET DLLs.

Additionally, the relative path in Project Properties -> Common Properties -> Framework and References -> (System) Assembly reference properties -> Relative Path (uneditable) is pointing to an x86 file.

Is there a solution?

Was it helpful?

Solution

This is entirely normal and not a problem. Reference assemblies are only used by the compiler to retrieve metadata, the declarations of the types in the assembly. The equivalent of .h files in native C++. Those declarations do not depend on the target architecture.

Architecture dependency is resolved at runtime. For .NET Framework assemblies that contain native code (mscorlib.dll, System.Data.dll, PresentationFramework.dll), the correct assembly is retrieved from a different GAC subdirectory. The GAC_32 subdirectory contains assemblies with 32-bit native code, GAC_64 for 64-bit, GAC_MSIL has the assemblies that contain pure IL and therefore have no architecture dependency.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top