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>