“the outputpath property is not set for this proje

2019-01-16 10:59发布

I have a multi project solution in Visual Studio 2008. I just added a new Configuration called Release-VersionIncrement to the solution, specifying "use release" configuration as baseline. All project files were updated with that configuration. However, when I am trying to compile a specific project using this configuration, I get the following error:

Error 5 The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Release-VersionIncrement' Platform='AnyCPU' C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets 539 9 DataConversion

What's happening here? The project compiles fine in Release or Debug configuration.

25条回答
▲ chillily
2楼-- · 2019-01-16 11:13

I have also seen this error when our build agent was configured to run platform "Any CPU" (with spaces as displayed in Visual Studio) rather than "AnyCPU" (one word as specified in the project file).

查看更多
叼着烟拽天下
3楼-- · 2019-01-16 11:13

I had this same error message. It was caused by having a reference to a project that was unloaded and not required by the linker (otherwise it would have failed at compile time). Removing the offending reference solved the issue.

查看更多
做自己的国王
4楼-- · 2019-01-16 11:13

In my case (VS2010) I removed string in the "OutputPath" box that is on "Build" tab and left it blank. Then I rebuilt the solution. Build was successful and VS has inserted current directory "./" into the "OutputPath". I replaced current directory "./" with my path ("bin\x64\Release\" -- suffice to say that this is exact folder path that was VS was complaining in the first place) and rebuild was successful again.

查看更多
我想做一个坏孩纸
5楼-- · 2019-01-16 11:13

When I added new solution configuration in my solution, I got an error, "The OutputPath property is not set for project X. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='QA' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. ProjectY".

In my case issue was due to highlighted part of the error description. Project X part of my solution was having a project reference to ProjectY of another solution(different branch).

I've resolved this issue by modifying project X to use project reference to ProjectY in the current solution. Hope this helps someone having similar issue.

查看更多
Viruses.
6楼-- · 2019-01-16 11:16

I had the same problem when I used MSBuild first. My solution is: use the OutputPath property definitely. Like this:

msbuild XXX.csproj /p:OutputPath=bin\Debug.
查看更多
爷的心禁止访问
7楼-- · 2019-01-16 11:19

In our case we were running a build script on our HP developer boxes. HP have some environment variables they've set up for their own purposes and one of them is PLATFORM (used, apparently, for "HP Easy Setup").

Deleting the PLATFORM environment variable worked.

You could also future-proof your build script by specifying the platform, i.e.
msbuild /p:Platform=AnyCPU.

查看更多
登录 后发表回答