Register / Log in

OK, here’s a problem I’ve been running into a lot lately, and I want to share my solution with you guys, since I think others have had this problem in the past as well.

I use Visual C# Express 2008 for my personal development at home.  I don’t have the money for the full version or I’d probably buy it for home.  The Express edition does most everything that I need it to do, so I’m satisfied with it for now.  When I get more money, I’ll be buying the full version of Visual Studio.  I’m sure many of you out there are doing this as well.

Anyway, the problem that I’ve been having is that I am making an application on a 64-bit architecture.  Visual C# Express 2008 builds 64-bit apps by default in this case.  The problem is that I am trying to create projects that are referencing 32-bit DLLs, but because they are different from the main 64-bit application, I get some bizzare errors when I run the app.

The good news is, we can get Visual C# Express 2008 to build 32-bit applications.  I’m sure this will hold true for Visual C# Express 2010 when it comes out as well.  The bad news is that Microsoft makes it fairly difficult to discover how to do this.

Microsoft has set up Visual C# Express to hide many of the options it has.  Their explanation would probably be that it is for novice programmers or hobbyists who may be buried in all of the advanced controls.  Now, I have no doubt that this is the case, but for some reason, I get the feeling that it is more of a trick to make me feel like I should buy the full version of Visual Studio, especially when I see a lot of posts on the Internet about how the Express editions can’t do what I’m trying to do here.

Note to all software developers:  if you have advanced controls in your program, let the user know about them up front, so that they can turn them on if they want.  Ideally, the user would be prompted when the program is installed to indicate whether they are a beginner or an advanced user, and configure the application appropriately, or at least, give a startup tip to the user telling them about it.

Anyway, the solution isn’t horribly complicated.  Here’s the steps to take to get Visual C# Express 2008 to compile a 32-bit application.

1. Choose Tools > Options from the menu.

2. In the Options window that comes up, look in the bottom left corner for the Show all settings check box and check it.

ClickTheShowAllSettingsBox

3.   In the tree on the left, choose Projects and Solutions > General.  In the panel on the right, check the Show advanced build configurations check box.

ShowAdvancedBuildConfigurations

You can now close the Options window.

4. Near the top of the window is a control for determining what kind of configuration you want to launch, wich now has more power so it can do what we need.  This is shown below.  In the second drop down box, which probably says Any CPU by default, choose the option that says Configuration Manager….

ChooseConfigurationManager

5. In the Configuration Manager window that appears, look near the top right for the drop down box labeled Active solution platform: and choose <New…> from it.

CreateNewSolution

6.  In the New Solution Platform window that appears, find the drop down box that says Type or select the new platform: and choose x86.

NewSolutionDialog

7. Close out of those windows and your default launch configuration will now be for 32-bit applications!  Note that you can change back to the way it was before by choosing Any CPU from the list at the top of the screen at any time.

View Comments

blog comments powered by Disqus