突然,在添加一些NuGet包(主要是与ASPNET标识相关)后,它开始显示此错误:
FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
我有针对.Net Framework 4.7.1的目标.我尝试安装NuGet包System.Runtime 4.3.0,它没有帮助.web.config文件有一个引用:
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
bin文件夹中没有System.Runtime.dll.
有任何想法吗?
我使用Visual Studio 2017 15.5.5.
更新:
我在.csproj文件中使用PackageReference条目,因此它不是packages.config的问题.
似乎没有加载某些依赖项.