“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条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-01-16 11:19

I had the same problem, and the only solution that helps was to set the Build Configuration Manually in each NCrunch Project.

Open the NCrunch Window, where you can see the Status of each Build and where you can see that the build failes. Right click on the project that fails to build and click on "configure selected component" there you see under "Build Settings" the property "Use build confoguration" set it to e.g. "Debug" and the property "Use build platform" set it to e.g. "AnyCPU". (Please note that the build and configuration settings you set must exist in your konfigration Settings)

Do this for all of your projects, but not for your test project. After this everything works fine for me.

查看更多
倾城 Initia
3楼-- · 2019-01-16 11:20

Like "Richard Dingwall" hinted, the problem is related to VS using the display version of "Any CPU" instead of the MSBuild version which actually reads "AnyCPU"

Go into Build/New Build Definition or Edit Build Definition -> Process -> Configurations to build, open the configuration selection dialog and in "Platform" instead of selecting "Any CPU", manually add "AnyCPU"

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

If anyone is getting this one in his NCrunch logs, check if the PropertyGroup defining the values 'Debug'/'Release' and 'AnyCPU'/'x86' located before the property groups using those values in their condition.

<PropertyGroup>
    <!-- this one first -->
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <XXX>...</XXX>
  </PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <XXX>...</XXX>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <XXX>...</XXX>
</PropertyGroup>

Worked for me.

查看更多
一纸荒年 Trace。
5楼-- · 2019-01-16 11:23

I was adding the x64 platform to my solution today, when I ran into this issue.

In my case, the error read:

Built $/ProjectDirectory/ProjectName.csproj for default targets. c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (484): The OutputPath property is not set for project ProjectName.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x64'. 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.

I knew the OutputPath should be fine, since this was an existing, working VS solution. So I moved to the next hint--"a valid combination of Configuration and Platform".

Aha! Visual Studio is trying to build Configuration='Debug', Platform='x64'. Looking at my project file, I realized that x64 was not listed as one of the possible platforms. In other words, I had the below entries (shortened):

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
      <PlatformTarget>x86</PlatformTarget>
      <OutputPath>bin\x86\Debug\</OutputPath>  
      . . .  
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
      <PlatformTarget>x86</PlatformTarget>
      <OutputPath>bin\x86\Release\</OutputPath>    
      . . .
  </PropertyGroup>

Easy fix then: just add x64 entries!

I copy/paste'd the x86 entries, and changed them to use x64. Notice I also modified the paths so these don't overwrite x86 builds:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
      <PlatformTarget>x64</PlatformTarget>
      <OutputPath>bin\x64\Debug\</OutputPath>    
      . . .
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
      <PlatformTarget>x64</PlatformTarget>
      <OutputPath>bin\x64\Release\</OutputPath>    
      . . .
  </PropertyGroup>
查看更多
冷血范
6楼-- · 2019-01-16 11:23

If you decide to set OutputPath as a param, and your path is like: bin\Release\\ then remember to add \ at the end like that: /p:OutputPath=bin\Release\\\\ it took me a while to realize it was the case

查看更多
在下西门庆
7楼-- · 2019-01-16 11:23

I had the same problem, I fixed it by adding missing Configurations to the project that was failing.

BUILD -> Configuration Manager ->

Under Configuration Column Add

Note: This only happened to be because I have custom configuration and newly created projects didn't have the configuration.

查看更多
登录 后发表回答