gpt4 book ai didi

ServiceStack.Interfaces.dll 不再复制到依赖项目

转载 作者:行者123 更新时间:2023-12-04 08:52:31 27 4
gpt4 key购买 nike

从 v3.9.43 通过 nuGet 升级到 ServiceStack v3.9.70 后,我注意到 ServiceStack.Interfaces.dll不再复制到依赖于使用 ServiceStack 的类库的项目中。这会导致以下错误:

System.IO.FileNotFoundException: Could not load file or assembly 'ServiceStack.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'ServiceStack.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

复制所有其他 ServiceStack dll,仅缺少 ServiceStack.Interfaces。所有引用都设置为 Copy Local = True , 而这个 StackOverflow post的建议并不能解决问题。

我注意到 ServiceStack.Interfaces.dll是唯一一个版本为 1.0.0.0,所有其他都设置为 3.9.70.0。这可能是一个原因吗?

有谁知道如何在引用我的类库的所有项目中在级联中手动引用 ServiceStack.Interfaces.dll 的情况下修复它?

更新 - 2014-03-06

v3.9.71.0 仍然存在问题。这确实与 ServiceStack.Interfaces 的事实有关。程序集的版本保留为 1.0.0.0 而不是。

我克隆了 ServiceStack 的 github 存储库,并在 build\build.proj 中更改了这一行。文件并运行 build\build.bat .
<!-- Exclude versioning future strong-named libs -->
<RegexTransform Include="$(BuildSolutionDir)/src/**/AssemblyInfo.cs"
Exclude="$(SrcDir)/ServiceStack.Interfaces*/Properties/AssemblyInfo.cs">
<Find>\d+\.\d+\.\d+\.\d+</Find>
<ReplaceWith>$(Version)</ReplaceWith>
</RegexTransform>

为此(注意到已删除的排除项)
<RegexTransform Include="$(BuildSolutionDir)/src/**/AssemblyInfo.cs">
<Find>\d+\.\d+\.\d+\.\d+</Find>
<ReplaceWith>$(Version)</ReplaceWith>
</RegexTransform>

结果 : 现在它可以正常工作了,即文件 ServiceStack.Interfaces.dll被复制到引用 ServiceStack 的项目的项目中.

有人可以向我解释一下吗?为什么要从版本控制中排除接口(interface)?

最佳答案

当 v4 发布时,程序集版本故意从 3.9.* 更改为 1.0.0.0。

可能是由于 v4 ServiceStack.Interfaces.dll being changed to being strong-named and versioned 4.0 . 'bsd' 3.9.* 版本已回滚到 1.0,可能显然是最旧的版本。

更多细节在 this SO answer 中注明.

关于ServiceStack.Interfaces.dll 不再复制到依赖项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19917328/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com