views:

187

answers:

5

I'm having a problem when I try to build my solution in C# Express 2008. I need to build it for 32-bit architecture, but it always build for 64-bit. In Visual Studio 2008 I can choose the architecture, but I can't find this option in C# Express.

Is there a way to do this in C# Express?

+3  A: 

Have a look at what the differences look like in the project file in the full Visual Studio, and hand-craft the same edits to your C# Express project - VS will respect those changes, even if it won't let you make them from within the IDE.

EDIT: As Jeff points out in the comments, if you go to Tools -> Options, tick the "Show all settings" box at the bottom left. Then under "Projects and solutions" tick "Show advanced build configurations". (These are the exact words from C# 2010 Express; it may be slightly different in C# 2008 Express.) That will let you edit a lot more build options, including the target architecture. You may need to go through the Configuration Manager and create a "New Project Platform" however.

Even when you've done this, bear the first paragraph in mind for other options which simply aren't available within C# Express: it's still using the same build engine (msbuild) underneath, so as long as it isn't using any tooling specific to more powerful versions (e.g. the static checker for Code Contracts, only available for Premium and Ultimate) you should be fine.

Jon Skeet
ok, thanks.So I will open it using VS, build it as 32 bits and then close it and open it again in C# express.
HoNgOuRu
I'll set this question as answered in 4 minutes. Thanks
HoNgOuRu
@Jon: You can do it in the IDE. You just need to change the Tools->Options to allow advanced features like Configuration management.
Jeff Yates
@Jeff: That's good to know, thanks. I'd assumed the OP had already looked. (Recently I had some other similar issue where I had to edit the build file. I can't remember what, exactly...)
Jon Skeet
@Jon: No problem. The setting is not exactly obvious if you don't already know about it.
Jeff Yates
A: 

In the project properties, you should be able to select the "Platform Target" - this can be "Any CPU", "x86", "x64", or "Itanium" for me (in VS2008). Is this selection not available in C# Express?

davisoa
Exactly, not in C# Express.
HoNgOuRu
That's why I was asking here, if there was another way of doing this.Thanks anyway!
HoNgOuRu
+3  A: 

Look at this question:

http://stackoverflow.com/questions/2812423/how-to-switch-between-debug-release-in-visual-c-2010-express

Following same approch suggested there, you will be able to set architecture for your program in Express editions. The problem it's that,by default some "advanced" options are disabled in Express editions, but you can easyly re-eanble them.

Andrea Parodi
thanks for your answer, but that example is for the Visual Studio I believe.There is no "Tools > Expert Settings" in C# Express Edition.
HoNgOuRu
@HoNgOuRu: There is - although it can be tricky to spot. I've edited my answer to give more details.
Jon Skeet
+1  A: 

By default, C# Express hides solution configurations from you. However, you can change this in the Tools->Options dialog so that you can then specify new build configurations and change their platform targets.

Jeff Yates
A: 

I found it. "Tools > Options > Project and Solutions > General > Show advanced build configurations" Thank you all.

HoNgOuRu