“the outputpath property is not set for this project” error

前端 未结 27 2500
野趣味
野趣味 2020-12-07 20:29

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\" configura

相关标签:
27条回答
  • 2020-12-07 20:49

    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.

    0 讨论(0)
  • 2020-12-07 20:50

    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.

    0 讨论(0)
  • 2020-12-07 20:52

    If Visual Studio specifically complains that "Platform='BPC'" then you can easily fix this by removing the "Platform" environment variable.

    Delete this bad boy.

    Now restart Visual Studio and you are good to go.

    0 讨论(0)
  • 2020-12-07 20:52

    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>
    
    0 讨论(0)
  • 2020-12-07 20:56

    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.
    
    0 讨论(0)
  • 2020-12-07 20:56

    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.

    0 讨论(0)
提交回复
热议问题