【问题标题】:TeamCity changing the hintpath in csproj filesTeamCity 更改 csproj 文件中的提示路径
【发布时间】:2016-11-17 19:30:58
【问题描述】:

TeamCity 正在更改我的 csproj 文件中某些 nuget 包的提示路径属性。因此,它正在为特定的 nuget 包恢复错误的版本,并且我在 CI 服务器上遇到了构建错误。否则一切正常,即使我自己提取 repo 并重建和恢复。

这是我在 git 中的内容:

<Reference Include="SimpleInjector, Version=3.2.3.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
  <HintPath>..\packages\SimpleInjector.3.2.3\lib\net45\SimpleInjector.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="SimpleInjector.Packaging, Version=3.2.3.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
  <HintPath>..\packages\SimpleInjector.Packaging.3.2.3\lib\net40-client\SimpleInjector.Packaging.dll</HintPath>
  <Private>True</Private>
</Reference>

这是它在 TeamCity 中所说的:

<Reference Include="SimpleInjector">
  <HintPath>..\packages\SimpleInjector.3.2.7\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector.Packaging">
  <HintPath>..\packages\SimpleInjector.Packaging.3.2.7\lib\net40-client\SimpleInjector.Packaging.dll</HintPath>
</Reference>

我不知道为什么会发生这种情况或如何防止它。任何人都对此问题有经验或知道我可以更改以防止它的项目设置?

【问题讨论】:

    标签: c# msbuild nuget teamcity csproj


    【解决方案1】:

    问题在于构建配置被设置为在 nuget restore 构建步骤中更新 nuget 包。我假设只有缓存的 nuget 包会在 package.config 与本地包不同时更新,但事实并非如此。如果有机会并且该标志设置为 true,TeamCity 将始终更新到最新的稳定 nuget 包。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-31
      • 2013-03-17
      • 2021-07-03
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-26
      相关资源
      最近更新 更多