12

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?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
HoNgOuRu
  • 717
  • 4
  • 13
  • 26

6 Answers6

14

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". 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.

mwfearnley
  • 3,303
  • 2
  • 34
  • 35
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 1
    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 Sep 07 '10 at 18:18
  • 1
    I'll set this question as answered in 4 minutes. Thanks – HoNgOuRu Sep 07 '10 at 18:19
  • 3
    You can do it in the IDE. You just need to change the Tools->Options to allow advanced features like Configuration management. – Jeff Yates Sep 07 '10 at 18:28
  • @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 Sep 07 '10 at 18:36
  • No problem. The setting is not exactly obvious if you don't already know about it. – Jeff Yates Sep 07 '10 at 20:12
6

Look at this question:

How to switch between debug and 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.

Community
  • 1
  • 1
Andrea Parodi
  • 5,534
  • 27
  • 46
  • 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 Sep 07 '10 at 18:33
  • @HoNgOuRu: There is - although it can be tricky to spot. I've edited my answer to give more details. – Jon Skeet Sep 07 '10 at 18:41
6

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

HoNgOuRu
  • 717
  • 4
  • 13
  • 26
3

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
  • 61,417
  • 20
  • 137
  • 189
1

I was getting this error as well, since I was running a 32-bit application on a 64-bit machine. I fixed this by going to the IIS app pool and changed the support 32bit option to true.

BI Metrics
  • 11
  • 2
1

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
  • 5,407
  • 1
  • 28
  • 34