The OutputPath property is not set for this projec

2019-01-08 09:57发布

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 see output path is set.

Here is the property group section for that .csproj file

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
  <DebugSymbols>true</DebugSymbols>
  <OutputPath>bin\x86\Debug\</OutputPath>
  <DefineConstants>DEBUG;TRACE</DefineConstants>
  <BaseAddress>285212672</BaseAddress>
  <FileAlignment>4096</FileAlignment>
  <DebugType>full</DebugType>
  <PlatformTarget>x86</PlatformTarget>
 <ErrorReport>prompt</ErrorReport>

Can any one shed the light on this?

NOTE: When I compiled this Debug and Any CPU it worked.

UPDATED: Error 1 The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Debug' Platform='x86'

16条回答
ら.Afraid
2楼-- · 2019-01-08 10:06

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.

查看更多
We Are One
3楼-- · 2019-01-08 10:06

After trying all the other suggestions posted here, I discovered the solution for me was to remove the following section from the .csproj file:

  <ItemGroup>
    <Service Include="{808359B6-6B82-4DF5-91FF-3FCBEEBAD811}" />
  </ItemGroup>

Apparently this service from the original project (unavailable on local machine) was halting the entire build process, even though it wasn't essential for compilation.

查看更多
冷血范
4楼-- · 2019-01-08 10:12

Another cause: you add a project reference from project A to project B in solution X. However, solution Y that already contains project A is now broken, until you also add project B to solution Y.

查看更多
相关推荐>>
5楼-- · 2019-01-08 10:16

I had the same problem, Just edit the .wixproj to have all of the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ... > elements to be side by side.

That solved my issue

查看更多
别忘想泡老子
6楼-- · 2019-01-08 10:19

I had the same problem after I have added new configurations and deleted the "debug" and "release" configs. In my case I was using a cmd file to run the build and publish process, but the same error was thrown. The solution for me: In the csproj file the following:

<Configuration Condition=" '$(Configuration)' == '' ">Debug< /Configuration>

was setting the Configuration to "Debug" if I did not specify an explicit one. After changing the node value from "debug" to my custom configuration, it all worked smoothly. Hope this will also help whoever is reading this :)

查看更多
孤傲高冷的网名
7楼-- · 2019-01-08 10:21

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.

查看更多
登录 后发表回答