Json.NET + VerificationException Operation could destabilize the runtime

独自空忆成欢 提交于 2020-01-30 04:12:15

问题


I am getting the "Operation could destablize the runtime exception". I goggled quite a bit, looks like exception has to do with conflicting assemblies being loaded at runtime. So, here are couple of things

  1. the same source code works in my colleagues machine.
  2. I looked and searched for each reference to NewtonSoft.Json.dll and it seems like its coming from a same assembly. (I think this would not be a problem as it is working in other people machine).
  3. I am using Raven which references NewtonSoft, but its not being used on the server side only on the client / silverlight side. Also to be compatible I am referencing to the same version of Newtonsoft that raven is referencing to.

Now, the problem might be something I installed in the machine that's affecting this. some runtime / SP install etc. Is there a way to debug / figure out what's happening here. I looked and searched for NewtonSoft.dll when the app runs and it gets right version in the temporary asp.net files. ?

Any help could be greatly appreciated. I don't want to go through installing my runtime.


回答1:


This exception can occur when you have Visual Studio Ultimate and IntelliTrace activated.

Try to add Newtonsoft.dll on IntelliTrace ignore list:

  • Tools -> Options -> IntelliTrace -> Modules
  • Add -> Newtonsoft.



回答2:


This bug is fixed in the latest version of Json.NET - http://james.newtonking.com/archive/2012/01/23/json-net-4-0-release-6-serialization-performance.aspx




回答3:


This is a known issue.

You should be able to fix this by removing all references to the JSON .NET library and adding them again to the projects.

See also:

http://json.codeplex.com/workitem/20624

JSON.Net throwing System.Security.VerificationException: Operation could destabilize the runtime



来源:https://stackoverflow.com/questions/5968084/json-net-verificationexception-operation-could-destabilize-the-runtime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!