从 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 帖子的建议并没有解决问题。
我注意到这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
。
有人可以向我解释一下吗?为什么要从版本控制中排除接口?