构建我的Jenkins/MSBuild解决方案给了我这个错误
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9): error :
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='Latest' Platform='AnyCPU'. 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.
[C:\<path>\<projectname>.csproj]
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
编辑
我在.csproj文件中有这个
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Latest|AnyCPU'">
<OutputPath>bin\Latest\</OutputPath>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
Jam*_*den 53
在文本编辑器中打开你的csproj,看看你是否有一个属性组部分,看起来应该是这样的:
<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>
Run Code Online (Sandbox Code Playgroud)
你有'最新'的构建配置吗?如果没有将上面的部分添加到csproj.
小智 38
我已经弄清楚它是如何工作的(不改变VS2013/2015中的sln/csproj属性).
如果你想构建.sln文件----/p:ConfigurationPlatforms = Release/p:Platform ="任何CPU",如果你想构建.csproj文件----/p:Configuration = Release/p:Platform = AnyCPU注意到"Any CPU"与AnyCPU
检查代码分析,fxcop,测试覆盖率(NCover)目标.以及MSBUILD应该正确定位.在我的情况下,它是"C:\ Windows\Microsoft.NET\Framework64\v4.0.30319",但它可以是不同的,因为你可以看到微软提供了6厘米的选项来构建代码库:: AMD(与交叉plt,x86& x64选项)和Windows(交叉,x86,x64)以及使用默认JIT进行代码开发时(也可以是PreJIT ngen.exe,econoJIT)
我认为使用power shell + msbuild可以处理更多故障排除.可能对某人有帮助......
小智 15
正如perlyking所提到的,而不是编辑csproj XML以下为我工作.以下是我使用的步骤.
为了添加@James所说的内容,我发现如果我查看VS2013中的项目Compile属性,则指定了Build Output Path .但是当我.csproj直接检查文件时,OutputPath相关构建配置缺少该元素.所以在VS中,我只是简单地制作并反转了对输出路径的次要编辑,保存了它,并将值放入项目文件中,然后我就可以构建了.
| 归档时间: |
|
| 查看次数: |
66658 次 |
| 最近记录: |