Jenkins Pipeline NotSerializableException: groovy.json.internal.LazyMap

Use JsonSlurperClassic instead. Since Groovy 2.3 (note: Jenkins 2.7.1 uses Groovy 2.4.7) JsonSlurper returns LazyMap instead of HashMap. This makes new implementation of JsonSlurper not thread safe and not serializable. This makes it unusable outside of @NonDSL functions in pipeline DSL scripts. However you can fall-back to groovy.json.JsonSlurperClassic which supports old behavior and could be … Read more

ASP.net MVC returning JSONP

Here is a simple solution, if you don’t want to define an action filter Client side code using jQuery: $.ajax(“http://www.myserver.com/Home/JsonpCall”, { dataType: “jsonp” }).done(function (result) {}); MVC controller action. Returns content result with JavaScript code executing callback function provided with query string. Also sets JavaScript MIME type for response. public ContentResult JsonpCall(string callback) { return … Read more

Could not load file or assembly ‘Newtonsoft.Json’ or one of its dependencies. Manifest definition does not match the assembly reference

To solve this, I ensured all my projects used the same version by running the following command and checking the results: update-package Newtonsoft.Json -reinstall And, lastly I removed the following from my web.config: <dependentAssembly> <assemblyIdentity name=”Newtonsoft.Json” publicKeyToken=”30ad4fe6b2a6aeed” culture=”neutral” /> <bindingRedirect oldVersion=”0.0.0.0-6.0.0.0″ newVersion=”6.0.0.0″ /> </dependentAssembly> If you want to ensure all your Newtonsoft.Json packages are the … Read more