2

I'm using Unity to build a so called "Universal Windows 8.1" app and trying to get the Pushwoosh SDK to work properly. Both the PushSDK.winmd and Newtonsoft.Json.dll gets copied over to the Visual Studio Project successfully. But when it eventually reaches the code:

NotificationService service = PushSDK.NotificationService.GetCurrent("my-id");

I get the following error:

enter image description here

This seems like a quite "general" problem and thus I'm posting it here. In my understanding the lib file "PushSDK.winmd" can't find the Newtonsoft.json.dll for some reason. But I'm unsure what more I can do. It is located under "References" in the project (see below):

enter image description here

EDIT What I've tried so far: 1. Rebuilding the Pushwoosh SDK with same DLL and also tried with another DLL. 2. Tried without a Newtonsoft.Json.dll at all.

Both of these produce the same error as seen above. Meaning it doesn't even read any DLL it simply can't find it.

Whyser
  • 2,187
  • 2
  • 20
  • 40
  • Do you have the correct assembly referenced? There are different builds of Newtonsoft.Json.dll for different platforms and .NET runtimes. – Cameron Tinker Apr 23 '15 at 13:45
  • Are you sure that the Newtonsoft.Json.dll that is referenced and copied actually matches the requested version from the error message? Seems like the PushSDK wants a .Net 4.5 version and you e.g. only have the 4.0 of the Newtonsoft.Json.dll. – Lennart Apr 23 '15 at 13:46
  • What version of Newtonsoft.Json do you have installed? (Right click and choose properties - it should tell you there) – Trevor Pilley Apr 23 '15 at 13:53
  • The one selected in the image has: Version: 4.5.0.0 and Runtime Version 4.0.3 (whatever that is). The Newtonsoft.json.dll is taken directly from the Pushwoosh github repo which should indicate it's the same. :/ Also, I can't see the source for the PushSDK-file – Whyser Apr 23 '15 at 13:58
  • https://github.com/Pushwoosh/pushwoosh-windows-8-sdk/tree/master/PushSDK/SDKBuild – Hans Passant Apr 23 '15 at 14:04
  • I tried rebuilding the whole Pushwoosh SDK with another DLL, and it's the same issue. :/ – Whyser Apr 23 '15 at 14:38
  • The problem is not that it can't find it. It actually can, it is just not the version that it wants. Something that *could* happen if another project in your solution also use Newtonsoft.Json for example and it is a later version. Diagnose this with Fuslogvw.exe, show us the error trace you get. – Hans Passant Apr 23 '15 at 16:06

1 Answers1

1

Yah, this only took about 6 hours to solve.

It seems the required step was to add the file Newtonsoft.Json.dll to the "Unprocessed Plugins"-list in Unity. Hope someone else will have use for this information.

Thanks for all the inputs given in the comments field!

Whyser
  • 2,187
  • 2
  • 20
  • 40
  • I'm getting: System.IO.FileNotFoundException: Assembly "PushSDK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" file not found. Any ideas on that one? – Adam Niles-Crane Walker May 22 '15 at 16:53
  • Well in what context are you using the library? Unity, building a native app or some other use? – Whyser May 23 '15 at 17:49