Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong platform "Any CPU" for project file (expects "AnyCPU") #900

Closed
thomaslevesque opened this issue May 19, 2016 · 4 comments
Closed

Wrong platform "Any CPU" for project file (expects "AnyCPU") #900

thomaslevesque opened this issue May 19, 2016 · 4 comments
Labels
Milestone

Comments

@thomaslevesque
Copy link
Contributor

What You Are Seeing?

If I use the MSBuild method to build a .csproj (rather than a solution) with PlatformTarget = PlatformTarget.MSIL, the wrong value is passed for the Platform property: for a solution, the correct value is "Any CPU", but for a project it's "AnyCPU" (no space). See this article for the explanation.

What is Expected?

When the file to build is a project rather than a solution, Cake should pass "AnyCPU" as the platform.

What version of Cake are you using?

0.11

Are you running on a 32 or 64 bit system?

64 bit

What environment are you running on? Windows? Linux? Mac?

Windows 8.1

Are you running on a CI Server? If so, which one?

Not right now

How Did You Get This To Happen? (Steps to Reproduce)

By building a .csproj with PlatformTarget = PlatformTarget.MSIL

Output Log

"D:\path\to\the\project\MyProject.csproj" (build target) (1) ->
(_CheckForInvalidConfigurationAndPlatform target) ->
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(723,5): error : The OutputPath property is not set for project 'MyProject.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='Any CPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [D:\path\to\the\project\MyProject.csproj]

@patriksvensson
Copy link
Member

@thomaslevesque Sorry for not getting back to you sooner about this. Everything looks fine at first glance. Sorry again. Will take a look at this tomorrow.

@thomaslevesque
Copy link
Contributor Author

No problem @patriksvensson, there's no rush ;)

@thomaslevesque
Copy link
Contributor Author

I realize now that a better way to fix it would be to add a Project property to MSBuildSettings, rather than relying on the extension to determine if it's a solution or project. If you prefer this approach, I'll update my PR.

@patriksvensson
Copy link
Member

@thomaslevesque I think the current implementation is good 😄 Not at a computer now but will take a look at it tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants