Posts Tagged ‘Visual Studio’

Visual C# 2008 Express

Saturday, May 10th, 2008

Well, I’ve been using Visual Studio Express (C#) as my development environment at home for a while now. I am use to standard Visual Studio Standard at work, but use Express at home. I’ve recently got a copy of Vista Home Basic (x64) and Visual C# 2008 Express builds “Any CPU” assemblies which seems to default to the current architecture. You can’t, at least via the interface that I can find, specify what assembly to produce (x86 x86) in Express. In standard you can setup build configurations for Debug/Release/x86/x64/Any CPU combinations. Express, on the other hand, is naff when it comes to this.

Long story short, I have been coding for Managed DirectX which are 32bit assemblies (x86) and my application level code has been compiling to x64 under Express as I have a 64bit machine. Result is a BadImageException at runtime as it load’s the 32bit Managed DirectX assembly from the GAC into a 64bit runtime application. Joy.

My solution has been to edit every one of my .csproj files manually to add the PlatformTarget tag like so:


<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>

I think I’m going to write an XNA renderer as hopefully XNA has 64bit assemblies…