从86更改一个Visual Studio C#项目的任何CPU [英] Changing a Visual Studio C# project from x86 to Any CPU
问题描述
我工作的一些C#项目与Visual Studio 2005,我想从86更改目标平台以任何CPU。我已经经历的一切,我知道,并确保他们还建了使用corflags工具的任何CPU的依赖了。
I am working on some C# projects with Visual Studio 2005, and I am trying to change the platform target from x86 to Any CPU. I already went through all the dependencies that I know about and made sure that they were also built for Any CPU using the corflags tool.
当我更改了目标平台Visual Studio 2005中,好像它保存的变化,但是当我生成项目仍然使用的x86反正。下一次我打开项目平台目标已重置为86。
When I change the platform target in Visual Studio 2005 it seems like it saves the change, but then when I build the project it still uses x86 anyway. The next time I open the project the platform target has been reset to x86.
这仅发生于一对情侣在解决方案中的项目,这是否意味着还有其他32位依赖地方?
This only happens for a couple of the projects in the solution, does this mean that there are other 32-bit dependencies somewhere?
我可以手动运行在命令行 /平台上的C#编译器:值为anycpu
,我没有得到一个错误,但我不知道这是做正确的事,我希望能够在Visual Studio中建立。
I can manually run the C# compiler on the command line with /platform:anycpu
and I don't get an error, but I'm not sure that is the right thing to do and I'd like to be able to build within Visual Studio.
我能做些什么来解决这个问题?
What can I do to solve this problem?
推荐答案
请确保你已经改变了双方在配置平台和目标平台以任何CPU
。如果一切都失败了,你可以打开 .csproj的
并手动更改引用。右键单击该项目,转到卸载项目。然后右键单击并转到编辑MyProject.csproj
。该项目的性质仍可能包括默认的平台为86:
Make sure you've changed both the Configuration Platform and the Platform Target to Any CPU
. If all else fails you can open up the .csproj
and manually change the references. Right click on the Project, goto Unload Project. Then right click and goto Edit MyProject.csproj
. The properties for the project may still include the default Platform as x86:
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
另外还要考虑那里的解决方案仍具有Configuration Manager中的86配置的情况。我发现,可与具有不同的配置我不得不花费大量的时间在配置管理器让一切直多个项目的一些复杂的解决方案。
Also consider the case where the Solution still has the x86 configuration in Configuration Manager. I've found for some complex Solutions with multiple projects that have different configurations I have to spend a lot of time in Configuration Manager getting everything straight.
这篇关于从86更改一个Visual Studio C#项目的任何CPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!