这是我得到的错误:
System.IO.FileNotFoundException:“无法加载文件或程序集'Newtonsoft.Json,Version = 12.0.0.0,Culture = neutral,PublicKeyToken = 30ad4fe6b2a6aeed'。系统找不到指定的文件。”
这是我的cs项目中的内容:
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
路径似乎是正确的。
我尝试找到不同的解决方案,例如重新安装早期版本的软件包和修改app.config为以下内容: <?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
什么都没有起作用。