The OutputPath property is not set for this project

前端 未结 20 1492
無奈伤痛
無奈伤痛 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:46

    The WiX project I was using was hard-set in the configuration manager for x64 across the board. When making the Custom Action project for the solution, it defaulted everything to x86 within the .csproj file. So I unloaded the project, edited it by changing all x86 to x64, saved, reloaded, and was good to go after that.

    I don't understand why I had to do this. The configuration manager was set to build as x64, but just wouldn't get set in the csproj file :(

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

    I had the same error, so I looked on project settings and there in "Build" section is "Build output path" option. And value was empty. So I filled in "bin\" value a error disappeared. It solved my problem.

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

    I had exact same error after adding a new configuration via ConfigurationManager in Visual Studio.

    It turned out when the 'Production' configuration was added for the whole solution (and each project) the OutputPath element was not added to the .csproj files.

    To fix, I went to the Build tab in project properties, changed OutputPath from \bin\Production\ to \bin\Production (deleted trailing \) and saved changes. This forced creation of the OutputPath element in the .csproj file and the project has built successfully.

    Sounds like a glitch to me.

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

    I have had similar issue on a Xamarin Project. It is maybe rare case but in case anyone else is having the issue. my project structure was like below

    • xamarin.Android project had a reference from xamarin.android.library project.
    • I created a plugin using some code from android.library project.
    • Now here is the problem. if you add project reference or nuget installation on xamarin.android library project. You will get this error. Developers assume that code was inside Android.Library project and i must reference the new plugin on this project. NO!
    • you must add a reference on Main Android project. because plugin->library->main project output isnt produced.
    0 讨论(0)
  • 2020-11-30 23:52

    If you get this error only when you try to compile your project from commandline using MSBuild (like in my case) then the solution is to passing the outputpath manually to MSBuild with an argument like /p:OutputPath=MyFolder.

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

    I have:

    1. Right-click on project with issue -> Unload Project
    2. Right-click on project and choose Edit *.csproj
    3. Copy-paste the configuration from existing configuration which works with specific name and targeting platform (I had Release | x64):

      <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
        <OutputPath>bin\x64\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <Optimize>true</Optimize>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x64</PlatformTarget>
        <ErrorReport>prompt</ErrorReport>
        <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
        <Prefer32Bit>true</Prefer32Bit>
      </PropertyGroup>
      
    4. Right-click project -> Reload Project
    5. Rebuild project/solution
    0 讨论(0)
提交回复
热议问题