Tim Anderson's ITWriting [Valid RSS]

Tech writing blog

Blog Home RSS Archives ITWriting.com
Add to Feedburner Add to Bloglines Add to Newsgator Add to My Yahoo

June 9, 2006

.NET 64-bit hassles

Posted 4092 days ago on June 9, 2006

Here's a tip if you are working with .NET 2.0 on 64-bit Windows:>/p>

Never forget you have two versions of .NET 2.0 installed

One is 32-bit, and the other 64-bit. That's all very cool, but can lead to unexpected problems. When you run a .NET application, it might get loaded by the 32-bit or 64-bit CLR depending on a flag in the assembly. In Visual Studio, you can set this by targeting "Any CPU" or "x86".

But what happens if an application starts as 64-bit, and then tries to load an assembly that requires 32-bit? Bad things. I've just run into this with Nunit. I have a 32-bit app in Visual Studio and I'm trying to use nunit. Nunit runs as 64-bit, tries to load the 32-bit assembly, and throws a FileNotFound exception.

The solution is to force Nunit to run as 32-bit. You can do this with corflags.exe which is in the .NET 2.0 SDK. Simple, once you figure out what the problem is.

See also this blog entry by Mark Smith.



No comments, be the first!


Comments are closed

Recent posts

Users plead with Borland to give up .NET
IE7 to be released 18th October,...
If Microsoft doesn't use UAC, why...
Google's unsettling lack of direction
Vista security: now prove it


Powered by bBlog