【问题标题】:Build on the Build Server Error: CS1730, After updating the Projects在构建服务器上构建错误:CS1730,更新项目后
【发布时间】:2013-04-26 15:18:11
【问题描述】:

第 1 步: 对以下 *.*proj 文件进行编辑

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.-->
  <Target Name="BeforeBuild">
    <Version VersionFile="..\VersionInfo.txt" RevisionType="Increment">
      <Output TaskParameter="Major" PropertyName="Major" />
      <Output TaskParameter="Minor" PropertyName="Minor" />
      <Output TaskParameter="Build" PropertyName="Build" />
      <Output TaskParameter="Revision" PropertyName="Revision" />
    </Version>
    <AssemblyInfo CodeLanguage="CS" OutputFile=".\Properties\AssemblyVersion.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)" />
  </Target>
  <!--
  <Target Name="AfterBuild">
  </Target>
  -->

第 2 步: 从 AssemblyInfo.cs 中删除 AssemblyVersion 编号和 AssemblyFileVersion

第 3 步: 在 sln 所在的位置之外创建一个名为 VersionInfo.text 的文件。

第 3 步: 将 AssemblyVersionNumber.cs 包含到项目中

第 4 步: 发出 MSBuild,在本地机器上工作正常,但在构建服务器上不行。

开发机器:(32 位)

C:\SVNHome\branches\MyGreatProject-II>msbuild -ver
Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3643]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

构建服务器:

D:\SVNHome\branches\source\MyGreatProject-II>%windir%\Microsoft.NET\Framework64\v3.5\msbuild
 -ver
Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.4234]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

在构建服务器上给出的错误消息没有帮助。

Properties\AssemblyInfo.cs:错误 CS1730:程序集和模块 属性必须在文件中定义的所有其他元素之前,除了 using 子句和外部别名声明

【问题讨论】:

  • 那么AssemblyVersion.cs 在两个系统上是什么样子的?
  • 问题,我现在有一个小问题。所有项目都给了我不同的增量数字我所有的二进制文件都不一样。
  • 您使用的是哪种构建服务器技术。您应该只为构建调用一次增量。因此,您可能需要将其包含在比构建所有项目的调用更早的位置。

标签: msbuild msbuildcommunitytasks


【解决方案1】:

这是我的错,去服务器,

  1. 撤消构建服务器上的所有签出
  2. 强制构建,然后它工作正常。
  3. 谢谢杰西豪温。就是这样。

【讨论】:

    猜你喜欢
    • 2017-04-16
    • 1970-01-01
    • 2013-03-11
    • 2018-02-05
    • 1970-01-01
    • 2021-10-25
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    相关资源
    最近更新 更多