The OutputPath property is not set for project
Solution 1:
I have figured out how it works (without changing sln/csproj properties in VS2013/2015).
- if you want to build .sln file:
/p:ConfigurationPlatforms=Release /p:Platform="Any CPU"
- if you want to build .csproj file:
-
/p:Configuration=Release /p:Platform=AnyCPU
- notice the
"Any CPU"
vsAnyCPU
- notice the
-
- check the code analysis, fxcop, test coverage(NCover) targets, as well as the MSBUILD should be located properly. In my case its:
-
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
but it can be different as you can see microsoft has given 6 cmd options to build code base::AMD (with cross plt, x86 & x64 options) and Windows(cross, x86, x64) and that also when code development happened with default JIT (it can be PreJIT ngen.exe, econoJIT)
-
I think more than this troubleshooting can be handle using power shell + msbuild. May be helpful for someone ...
Solution 2:
Open up your csproj in a text editor and see if you have a property group section, should look something like this:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Latest|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Latest\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
Do you have a 'Latest' build configuration? If not add the above section to the csproj.
Solution 3:
As mentioned by perlyking, rather than editing the csproj XML The following worked for me. Here are the steps I used.
- Open the Project Properties.
- Select the Build Tab.
- Under the Output section, Check that an output path is set. (if not set one, save the project and it should work).
- If it is set, click on the "Browse..." button of the output path.
- When the folder selection dialog opens, Navigate up one level in the file browser and then re-select the output folder and click the "Select Folder" button.
- Save the project properties and it should work.
Solution 4:
To add to what @James said, I found that if I looked at the project Compile properties in VS2013, the Build Output Path was specified. But when I examined the .csproj
file directly, the OutputPath
element was missing for the relevant build configuration. So in VS I simply made and reversed a minor edit to the output path, saved it, and that kicked the value into the project file, and I was then able to build.