Asked by:
CRM Online 2013 - Connect to SP Online - Getting error with dll 'Newton.soft' v6.0

Question
-
Hi,
I'm currently trying to develop a CRM Online 2013 plugin that connect to a SP Online 2013 of the same instance via Office 365 to push CRM annotation documents to a SP Online folder.
I'm using a dll named 'Newtonsoft.json' and installed it via the VS package manager => The version installed is the last (6.0.4) => https://www.nuget.org/packages/newtonsoft.json/
This dll permit to serialize and deserialize objects.
When i'm trying to debug my plugin i get the issue "could not load file or assembly 'newtonsoft.json' version 6.0.0.0".
When i check the reference property i can see that the dll installed is the version 6.0.0.0 -- Why ?
I've uninstalled and installed the dll with different version and i get the same problem.
I would like to know if someone have already got this issue ?
Thank you very much for your help.
Regards,
Jean-Michel
Monday, September 1, 2014 9:00 AM
All replies
-
Hi Jean,
I suspect that registering json.net in sandbox is causing issue. I can check same in onpremise tomorrow and report back to you. Guido seems to have worked a lot on crm online. He might be able to comment
regards,
Jithesh
Monday, September 1, 2014 1:02 PM -
did you merge the newtonsoft.json dll to with your plugin assembly?
My blog: www.crmanswers.net - Rockstar 365 Profile
Monday, September 1, 2014 4:24 PM -
Hi,
Thanks Jithesh and Guido for your replies.
Guido, What do you mean about "Merge the dll with my plugin assembly" ?
What i've made is just install the "newtonsoft.json.dll" with the "Package Manager Console". The reference was automatically added on the plugin project.
Thanks for your help again.
Regards,
Jean-Michel
Thursday, September 4, 2014 1:08 PM -
you could publish your project and all dlls into a single output dll. I think this is what Guido meant.
Jithesh
Thursday, September 4, 2014 1:13 PM -
Hi,
Thanks Jithesh and Guido for your replies.
Guido, What do you mean about "Merge the dll with my plugin assembly" ?
What i've made is just install the "newtonsoft.json.dll" with the "Package Manager Console". The reference was automatically added on the plugin project.
Thanks for your help again.
Regards,
Jean-Michel
when you register a plugin only your dll is deployed, referenced dlls are not.
Because your CRM is online you can't add the newtonsoft.json.dll inside the GAC or in the Bin folder, you need to merge the referenced dll with your plugin dll.
Here an MSDN article:
http://blogs.msdn.com/b/crm/archive/2010/11/09/how-to-reference-assemblies-from-plug-ins.aspx
My blog: www.crmanswers.net - Rockstar 365 Profile
Thursday, September 4, 2014 1:22 PM -
Hello,
Thanks Guido for your reply.
I'll try to merge the newtonsoft.dll with the plugin.dll.
For the moment i'm trying to use another way that is "CSOM".
I'm using 2 SP dll "SharePoint.Client.dll" ans "Sharepoint.Client.Runtime.dll" but when i debug the plugin, i'm facing the same issue "Could not find file or assembly 'SharePoint.client.dll' version 15.0.0.0".
I think this is the same problem with dll dependences.
Regards,
Jean-Michel
Friday, September 5, 2014 1:40 PM -
Hi,
I've installed ILMERGE package (last version 2.13.307) but when i want merge 2 dll (plugin.dll with newtonsoft.json.dll) i receive the error "ILMerge.Merge: Could not find the file 'ilmerge'.
I've checked on the net the correct syntax that i have to use but i do someting wrong :)
Here's the syntax i use :
C:\Users\jdossantos>"C:\Users\jdossantos\Documents\Visual Studio 2012\Projects\AmfDev\packages\ilmerge.2.13.0307\ILMerge.exe" ilmerge /target:library /out:AmfDev.MergedPlugins.dll AmfDev.Plugins.dll Newtonsoft.Json.dll An exception occurred during merging: ILMerge.Merge: Could not find the file 'ilmerge'. à ILMerging.ILMerge.Merge() à ILMerging.ILMerge.Main(String[] args)
Thank you very much for your help.
Regards,
Jean-Michel
Thursday, September 11, 2014 2:51 PM