使用NuGet运行包更新后,我无法再运行我的应用程序。它构建得很好,但在运行时我会收到:
Could not load file or assembly 'ServiceStack.Interfaces, Version=4.0.2.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43' or one of its dependencies. The system cannot find the file specified.
这似乎是因为版本号不正确,但我找不到解决方法,因为该号码不会出现在任何用户可编辑的文件中。事实上,我的.csproj正在寻找Version=4.0.0.0
。改变它没有任何有用的效果。
我第一次安装ServiceStack.Redis时,我不得不手动修复我的.csproj文件中的引用以使用正确的版本,但这次似乎修复不起作用。
我不确定我是否不明白如何使用NuGet,或者这些软件包是否已损坏,但如何才能安装?
编辑 - packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Common" version="4.0.11" targetFramework="net40" />
<package id="ServiceStack.Interfaces" version="4.0.11" targetFramework="net40" />
<package id="ServiceStack.Redis" version="4.0.11" targetFramework="net40" />
<package id="ServiceStack.Text" version="4.0.11" targetFramework="net40" />
</packages>
答案 0 :(得分:1)
你有脏dll,需要对所有ServiceStack软件包进行清理卸载。即
/packages
文件夹和 packages.config /bin
和/obj
文件夹然后从这个干净的平板开始,再次从NuGet安装软件包。