Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用自己版本的Newtonsoft.Json_C#_Build_Json.net_.net Assembly_Strongname - Fatal编程技术网

C# 使用自己版本的Newtonsoft.Json

C# 使用自己版本的Newtonsoft.Json,c#,build,json.net,.net-assembly,strongname,C#,Build,Json.net,.net Assembly,Strongname,我用JsonSchema的一些新功能扩展了Newtonsoft.Json 问题是我不能将Newtonsoft.Json程序集包含到我的项目中 当我这样做时,一切都会编译,但在运行时,一旦尝试加载System.Net.Http.Formatting,它就会崩溃。由于此程序集使用Newtonsoft.Json的4.5.0.0版本,因此会触发重定向,但重定向仅适用于已签名的程序集,并且我没有Newtonsoft.Json的签名密钥 Could not load file or assembly 'Ne

我用JsonSchema的一些新功能扩展了Newtonsoft.Json

问题是我不能将Newtonsoft.Json程序集包含到我的项目中

当我这样做时,一切都会编译,但在运行时,一旦尝试加载System.Net.Http.Formatting,它就会崩溃。由于此程序集使用Newtonsoft.Json的4.5.0.0版本,因此会触发重定向,但重定向仅适用于已签名的程序集,并且我没有Newtonsoft.Json的签名密钥

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified
=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
 (Fully-specified)
LOG: Appbase = file:///C:/work/visualstudio/x/x/
LOG: Initial PrivatePath = C:\work\visualstudio\x\x\bin
Calling assembly : System.Net.Http.Formatting, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\work\visualstudio\x\x\web.config
LOG: Using host configuration file: C:\Users\x\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 6.0.0.0.
LOG: Post-policy reference: Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
我尝试过在Newtonsoft.Json中使用动态密钥进行签名,但这与他们使用的不同,我只是得到了另一个错误,即他们不一样


任何人都有这个问题的解决方案,或者如何在不重命名所有内容的情况下使用此程序集的其他诀窍。

我为Microsoft添加了一个功能请求,以使用重定向启用多个publikkeytoken。这将解决很多问题。但不确定修复有多容易。以下是针对Microsoft的报告: