你好,这是我第一次使用msbuild,我似乎无法将其编译为dll,我一直在获取
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(490,9): e rror : The OutputPath property is not set for this project. Please check to mak e sure that you have specified a valid Configuration/Platform combination. Conf iguration='Debug' Platform='Any CPU'
最佳答案
您的.csproj文件应包含<OutputPath>bin\Debug\</OutputPath>
。当Visual Studio创建项目文件时,它将<OutputPath>
放入由Configuration和Platform组合条件的<PropertyGroup>
元素中,如下所示:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
...
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
...
</PropertyGroup>
Debug
用作Configuration
的默认值,将AnyCPU
用作Platform
的默认值,就像您的错误消息所说的那样。<PropertyGroup>
的<OutputPath>
。MSBuild my.csproj /p:OutputPath=bin\Debug\
<PropertyGroup>
的<OutputPath>
也具有可能需要的更多选项,因此您可能只需要在项目文件中找到Configuration和Platform的有效组合即可。找到这样的组合后,您可以使用相同的命令行开关相应地设置属性:MSBuild my.csproj /p:Configuration=Release /p:Platform=x86
https://stackoverflow.com/questions/12279933/