The OutputPath property is not set for this project

前端 未结 20 1491
無奈伤痛
無奈伤痛 2020-11-30 23:20

When I try to compile my project from x86 debug mode in Visual Studio 2008. I am getting this error. When I looked at the property group of the project that complained, I se

相关标签:
20条回答
  • 2020-11-30 23:54

    had this problem as output from Azure DevOps after setting to build the .csproj instead of the .sln in the Build Pipeline.

    The solution for me: Edit .csproj of the affected project, then copy your whole

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCpu' ">
    

    Node, paste it, and then change the first line as followed:

        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|any cpu' ">
    

    The reason is, that in my case the error said

    Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='release'  Platform='any cpu'.  
    

    Why Azure wants to use "any cpu" instead of the default "AnyCpu" is a mystery for me, but this hack works.

    0 讨论(0)
  • 2020-11-30 23:56

    I encountered the same error but the problem turned out to be because I had created a new configuration in my solution that didn't exist in referenced assemblies from another solution.

    This can be resolved by opening the related solution and adding the new configuration to it as well.

    This post gave me the idea to check the referenced assemblies after I'd already confirmed that all projects within my solution had the correct configuration:

    http://gabrielmagana.com/2010/04/solution-to-the-outputpath-property-is-not-set-for-this-project/

    0 讨论(0)
  • 2020-11-30 23:58

    If you are using WiX look at this (there is a bug) http://www.cnblogs.com/xixifusigao/archive/2012/03/20/2407651.html

    Sometimes new build configurations get added to the .wixproj file further down the file, that is, separated from their sibling config definitions by other unrelated XML elements.

    Simply edit the .wixproj file so that all the <PropertyGroup> sections that define your build configs are adjacent to one another. (To edit the .wixproj in VS2013 right click on project in Solution Explorer, Unload project, right-click again->Edit YourProject.wixproj. Reload after editing the file.)

    0 讨论(0)
  • 2020-11-30 23:59

    You can see this error in VS 2008 if you have a project in your solution that references an assembly that cannot be found. This could happen if the assembly comes from another project that is not part of your solution but should be. In this case simply adding the correct project to the solution will solve it.

    Check the References section of each project in your solution. If any of them has a reference with an red x next to it, then it you have found your problem. That assembly reference cannot be found by the solution.

    The error message is a bit confusing but I've seen this many times.

    0 讨论(0)
  • 2020-12-01 00:00

    I encountered this problem when adding a project to a solution then referencing it from yet another project in the same solution-- got the yellow warning icon over the reference, notice that path was empty.

    The solution was similar to what @Amzath suggested, my projects were being compiled with different Target Frameworks, eg. .NET 4.0 vs 4.5.

    0 讨论(0)
  • 2020-12-01 00:02

    This happened to me because I had moved the following line close to the beginning of the .csproj file:

      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
    

    It needs to be placed after the PropertyGroups that define your Configuration|Platform.

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