.Net x64 / x32 incompatibility "is ambiguous in the namespace"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I ma trying to compile my XP x32 build after reboot into XPx64 as native x64
application. In VS2005 I changed my VB.net configuration to x64 and changed
the reference path to point to c:\windows\microsoft.net\framework64 (before
it was without the 64). Most things fell into place after these changes, but
several classes are no longer available in the interllisense completion list
and they are listed as errors as well. Even simple things such as
Debug.Assert() are no longer available. Sample error: 'Debug' is ambiguous in
the namespace 'System.Dosagnostics'.

Do those classses really not exist as 64 bit version?

What is the best way to resolve this?

Thanks, Ingmar
 
What I learned by now:

changing the reference path to point to c:\windows\microsoft.net\framework64
is bad. Keep it at c:\windows\microsoft.net\framework

Setting the target to x64 is bad also, set it to AnyCPU instead. And make
sure this is consistent across all .dsps (project files)

With those settings the before mentioned problems go away and the created
assembly will contain code for x32 and x64 and upon execution the one
matching the system will be used.

Unfortunately, it is not possible to call 32bit .DLLs from a 64 binary, so
those have to be compiled for 64bit as well.
 
Back
Top