MSBuild task configuration property

断了今生、忘了曾经 提交于 2019-11-28 09:02:56
AnneTheAgile

Regarding the question of spelling of platform any cpu, it turns out there is an issue, already reported elsewhere here on StackOverflow and Microsoft. It affects MSBuild in general and the entire issue of Platform documentation is omitted in my dotnet v3.5 MSBuild /help. So perhaps this will help someone!

Links

"AnyCPU" vs "Any CPU" in TFS 2010
MSBuild inconsistent platform for "Any CPU" between solution and project

Closed as Won't Fix   
Type:  Bug
ID:  503935  
Opened:  10/26/2009 1:29:12 PM
Access Restriction:  Public  
0 Workaround(s)
5 User(s) can reproduce this bug  

The MSBuild Platform property has a different value for Any CPU depending upon whether you are building a solution or building a project.
- for Solution - use Platform="Any CPU" - with space
- for Project - use Platform="AnyCPU" - without space

OK I have found the issue. Nothing related to MSBuild, but instead the solution being built. Posting to save someone else the heartache.

For whatever reason the Debug configuration was configured within the solution like so:

alt text http://www.freeimagehosting.net/uploads/cad0bdf1c0.jpg

So MSBuild was only doing what it was told too...

I was getting this same error. The solution was to explicitly specify the target platform with:

msbuild.exe /p:Platform="Any CPU"

This only started happening since I upgraded to windows 7, so I guess it is something to do with that.

Have you tried running with /v:diag?

Also, aside: I think you want "AnyCPU" (no space).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!