Getting Flurl and similar network dlls to work with Unity

I’ve a few dlls that I need to access some things on a server “easily” (as I have code that will do the job, if only I can get Unity set up with the dlls).

Here’s the dlls I need; Flurl, Flurl.Http and Newtonsoft.Json

I got these as nuget packages, renamed them to .zips, extracted the .dll files and dropped them in the plugins folder.

I’ve tried playing the Unity .net version, I’ve tried different .Net versions of the .dlls and generally get pretty much the same errors:

Assembly ‘Library/ScriptAssemblies/Assembly-CSharp.dll’ will not be loaded due to errors:
Reference has errors ‘Flurl.Http’.

Assembly ‘Assets/Plugins/Flurl.Http.dll’ will not be loaded due to errors:
Unable to resolve reference ‘Newtonsoft.Json’.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorPluginImporterExtension+EditorProperty.Reset (UnityEditor.PluginImporterInspector inspector) (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/EditorPluginImporterExtension.cs:37)
UnityEditor.Modules.DefaultPluginImporterExtension.RefreshProperties (UnityEditor.PluginImporterInspector inspector) (at C:/buildslave/unity/build/Editor/Mono/Modules/DefaultPluginImporterExtension.cs:132)
UnityEditor.Modules.DefaultPluginImporterExtension.OnEnable (UnityEditor.PluginImporterInspector inspector) (at C:/buildslave/unity/build/Editor/Mono/Modules/DefaultPluginImporterExtension.cs:109)
UnityEditor.PluginImporterInspector.OnEnable () (at C:/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/PluginImporterInspector.cs:450)

Some of these get repeated once.

This seems like it should be simple… where am I going wrong?

OK, I seem to have solved this. (I say “seem” because the code I have to test things is not designed to fail gracefully and with no connection it hangs Unity and I have to kill it with taskmanager).

Assuming the above paragraph problem is something else; There are multiple .net versions of the various dlls. The critical thing seemed to be having Newtonsoft.json to be .Net 4.0 (obviously with Unity set to 4.x). I thought I’d already tried that so I’m a little bemused. Hopefully this helps someone else.