本文介绍了编辑.csproj文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试编辑.csproj文件.
我在其中添加了以下代码块:
< PropertyGroup > ; < UpdateBuildNoAssemblyPath > D:\ CustomBuildTasks \ UpdateBuildNoTask.dll < /UpdateBuildNoAssemblyPath > < BuildNoFilePath > $(SolutionDir )\ BuildNumber.txt < /BuildNoFilePath > < /PropertyGroup > < UsingTask TaskName =" UpdateBuildNoTask" AssemblyFile =" $(UpdateBuildNoAssemblyPath )" / > < 目标 名称 =" UpdateBuildNo" > < UpdateBuildNoTask 条件 =" Exists('$(UpdateBuildNoAssemblyPath)')" BuildNoFilePath =" $(BuildNoFilePath)" / > < /Target > <!- 导入MSBuildCommunityTask目标 -> < 导入 项目 =" $(MSBuildExtensionsPath)\ MSBuildCommunityTasks \ MSBuild.Community.Tasks.Targets " / > <!- 到AssemblyInfo以包含svn修订版号 -> < 目标 名称 =" BeforeBuild" > < SvnVersion LocalPath =" $(MSBuildProjectDirectory)" 条件 =" 存在('D:\ Program Files(x86)\ CollabNet Subversion Server \ svn.exe')" 工具路径 =" D:\ Program Files(x86)\ CollabNet Subversion Server" > < 输出 TaskParameter =" 修订版" PropertyName =" 修订" / > < /SvnVersion > < FileUpdate 条件 =" $(Revision)!=''" 文件 =" Properties \ AssemblyInfo.cs" regex =" (\ d +)\.(\ d +)\.(\ d +)\.(\ d +)" ReplacementText =" $ 1. $ 2. $ 3.$(修订版)" / > < CallTarget 目标 =" UpdateBuildNo" / > < /Target >
巡航控制系统给我这个错误:
< message>完成的建筑项目"d:\ build \ projName.WebApp.csproj"(打包目标)-失败.;
我不知道出了什么问题.
解决方案
I am trying to edit the .csproj file.
I added the following block to it:
<PropertyGroup> <UpdateBuildNoAssemblyPath>D:\CustomBuildTasks\UpdateBuildNoTask.dll</UpdateBuildNoAssemblyPath> <BuildNoFilePath>$(SolutionDir)\BuildNumber.txt</BuildNoFilePath> </PropertyGroup> <UsingTask TaskName="UpdateBuildNoTask" AssemblyFile="$(UpdateBuildNoAssemblyPath)" /> <Target Name="UpdateBuildNo"> <UpdateBuildNoTask Condition="Exists('$(UpdateBuildNoAssemblyPath)')" BuildNoFilePath="$(BuildNoFilePath)" /> </Target> <!-- Import of the MSBuildCommunityTask targets --> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> <!-- to AssemblyInfo to include svn revision number --> <Target Name="BeforeBuild"> <SvnVersion LocalPath="$(MSBuildProjectDirectory)" Condition="Exists('D:\Program Files (x86)\CollabNet Subversion Server\svn.exe')" ToolPath="D:\Program Files (x86)\CollabNet Subversion Server"> <Output TaskParameter="Revision" PropertyName="Revision" /> </SvnVersion> <FileUpdate Condition="$(Revision)!=''" Files="Properties\AssemblyInfo.cs" Regex="(\d+)\.(\d+)\.(\d+)\.(\d+)" ReplacementText="$1.$2.$3.$(Revision)" /> <CallTarget Targets="UpdateBuildNo" /> </Target>
The cruise control gives me this error:
<message>Done Building Project "d:\build\projName.WebApp.csproj" (Package target(s)) -- FAILED.;
I have no clue what is wrong.
解决方案
这篇关于编辑.csproj文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!