Estaba agregando la plataforma x64 a mi solución hoy, cuando me encontré con este problema.
En mi caso, el error de lectura:
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.
sabía que el OutputPath
debe estar bien, ya que esta fue una ya existente, trabajando VS solución. Así que pasé a la siguiente sugerencia: "una combinación válida de configuración y plataforma".
Aha! Visual Studio está intentando compilar Configuration='Debug', Platform='x64'
. Al mirar mi archivo de proyecto, me di cuenta de que x64 no figuraba como una de las plataformas posibles. En otras palabras, tenía las siguientes entradas (acortadas):
<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>
Solución fácil: solo agregue x64 entradas.
Copié/pegué las entradas x86 y las cambié para usar x64. Nótese también he modificado los caminos por lo que estos no sobreescriben x86 construye:
<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>
Luché con esto durante horas hasta que me di cuenta de que la lista desplegable en la definición de compilación TFS tiene "Cualquier CPU" en lugar de "AnyCPU" !!!! –
En VS2012, el menú desplegable en la configuración de compilación es "Cualquier CPU", pero dentro del archivo .csproj es "AnyCPU", por lo que en Jenkins o en la línea de comandos, el uso "AnyCPU" funcionará. –