0

I built a very simple SSIS script function to retrieve data from an API and convert the JSON response to XML. I used json.net deserializexmlnode and it worked perfect in Visual Studio 2008 - unfortunately I was forced to upgrade to 2012 and I cannot for the life of me get the json.net functions to work, I have:

  • reloaded the reference with NuGet
  • reloaded the reference manually
  • verified that I was using the correct version for .net 4.5
  • tried the .net 4.0 and 3.5 versions for good measure attempted workarounds using System.Runtime.Serialization.Json, but that results in other errors

here is the line with the error:

System.Xml.XmlDocument xmlResult = Newtonsoft.Json.JsonConvert.DeserializeXmlNode(strResponse, "Root");

it worked fine in 2008, but now everytime I get:

DTS Script Task: Runtime Error
Exception has been thrown by the target of an invocation.

 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

Any help you all could provide would be greatly appreciated.

Thanks

Nagendra Rao
  • 7,016
  • 5
  • 54
  • 92
  • 1
    VtC as a duplicate. I'm assuming you need to register/reregister the assembly in the GAC. `gacutil -if Newtonsoft.dll` Otherwise, we'll need more code to repro your issue. – billinkc Jan 15 '14 at 22:51
  • Thanks so much for your help with this - it seems to be working fine now. – user2430098 Jan 16 '14 at 15:50

0 Answers0