Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling .ink files in Windows for Unity throws an Exception #16

Closed
bncastle opened this issue Jun 23, 2016 · 5 comments
Closed

Compiling .ink files in Windows for Unity throws an Exception #16

bncastle opened this issue Jun 23, 2016 · 5 comments

Comments

@bncastle
Copy link
Contributor

bncastle commented Jun 23, 2016

I'm running Unity 5.3.5f1 for Windows. When do a clean pull of the ink-unity-integration project, and try to compile an inkfile (such as Basic/story.ink) I get the following error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at Ink.Runtime.Story.ToJsonString(Boolean indented)
   at Ink.CommandLineTool..ctor(String[] args)
   at Ink.CommandLineTool.Main(String[] args)

UnityEngine.Debug:LogError(Object)
Ink.UnityIntegration.InkCompiler:Delay() (at Assets/Plugins/Ink/Editor/Compiler/InkCompiler.cs:173)
UnityEditor.EditorApplication:Internal_CallDelayFunctions()

From my understanding, Unity3d's current Mono framework version only supports dlls compiled for .NET Framework 3.5 or earlier. Looking at the Nuget packages.config files for the Visual Studio solution, they specify different target frameworks for Newtonsoft.Json.dll in the ink-engine-dll and inklecate projects. For the ink-engine-dll project, it's "net35". For the inklecate project, it's "net45" which is fine ... until you bring inklecate_win.exe and ink-engine.dll into Unity and throw them in the same directory. They both want different Newtonsoft.Json dlls for different framework targets and this causes the issue.
diffdlls

If I'm not mistaken you have moved some files around yes? I'm betting you don't see this behavior on Mac OS, but I'm not sure why exactly. I only know that it happens in Windows. If I separate both inklecate_win.exe and ink-engine.dll into their own directories and give them the Newtsonsoft.Json.dlls they want, all is well. Then of course there are two Json dlls hanging around which feels icky.

Update: The solution is to compile Inklecate using the .NET 3.5 version of the Netwonsoft dll and all is well. This requires some changes in the VS solution file.

@Tayx94
Copy link

Tayx94 commented Jun 25, 2016

I get the exact same error when I updated to ink 0.3.5. I tried downloading different versions of Newtonsoft.Json.dll, but none of them seem to work. Will try ink 0.3.4 while we wait for the fix.

@joethephish
Copy link
Member

Oh dear, sorry to hear this guys! Will see if we can work out what's gone wrong here...

@clembu
Copy link

clembu commented Jun 29, 2016

Having the same error log. Ink settings in Unity Editor said something about API compatibilities being .net 2.0 and having to be changed to .net 2.0 (which is said on the main page of this github, but doesn't make any sense to me). I clicked the button "fix" under the message and it solved nothing.

@hoverbird
Copy link

Same error here, ink-unity 0.3.5, Unity 5.4.0b18, Windows 10. Will try downgrading to 0.3.4

@joethephish
Copy link
Member

This should be fixed in the latest version where we've removed our dependency on Newtonsoft.Json.dll. But let us know if you still have any problems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants