开发者

How to set a project output platform to x86 in Visual Studio 2010

开发者 https://www.devze.com 2023-03-14 02:05 出处:网络
In my solution with several projects I am trying to change the Platform from Any CPU to x86.But x86 is not in the drop down.What do I need to do to be able to choose x86?

In my solution with several projects I am trying to change the Platform from Any CPU to x86. But x86 is not in the drop down. What do I need to do to be able to choose x86?

I need to change to x86 because of an System.BadImageFormatException error, as per this question: What causes System.BadImageFormatException when constructing System.Data.SQLite.SQLiteConnection

How to set a project output platform to x86 in Visual Studio 2010

And, in a possibly related problem, the newest project in the solution is missing one of the configurations from the configuration drop down:

How to set a project output platform to x86 in Visual Studio 2010

It should have a "Staging" configuration like all of the other projects, but does not. How do I add it?

EDIT:

If I choose the "New ..." option, then it asks me to copy from开发者_如何学C "Any CPU". If I copy from "Any CPU", isnt that just the same as using "Any CPU" in the first place?

How to set a project output platform to x86 in Visual Studio 2010


Both the Configuration and Platform drop downs have a:

  • <New...>

option. In fact you have them circled in your annotated screenshots!

Use that option to create the "Staging" configuration and the "x86" platform for the corresponding project.


You can set project platform using the /platform compiler switch like below

/platform:string

Where the string can be either of x86, Itanium, x64, or anycpu (default)

csc /platform:x86 myprogram.cs

In case you want to achieve the same from Visual Studio then you can follow the below steps

  1. Open the Properties page for the project.

  2. Click the Build property page.

3.Modify the Platform target property.

See Here For more information on the same.


I removed a solution platform and created it again with Create new project platforms check-box. It helped.

0

精彩评论

暂无评论...
验证码 换一张
取 消