moonsharp-devs / moonsharp

An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
http://www.moonsharp.org
Other
1.4k stars 213 forks source link

Winrt (Windows Store App) not working with version 2.0 #169

Open raV720 opened 7 years ago

raV720 commented 7 years ago

Moonsharp in version 2.0 does not work on Winrt platform. During starting app there is an exception:

An exception of type 'System.IO.FileNotFoundException' occurred in MoonsharpTest.exe but was not handled in user code

Additional information: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Steps to reproduce:

  1. Create Windows Store App 8.1
  2. Install Moonsharp 2.0 from nuget
  3. Test method to MainPage code behind: private void Test() { MoonSharp.Interpreter.Script script = new MoonSharp.Interpreter.Script(); }
  4. Call this method from constructor of MainPage
  5. Run and see exception
  6. Downgrade moonsharp to 1.8 - exception disappears
bplu4t2f commented 7 years ago

You've probably figured this out already but the problem is that it's adding the "netcore" dll to your project references, when it should add the "portable" dll. To fix it, remove the project reference to Moonsharp.Interpreter, and add a new reference to (SolutionDir)\packages\MoonSharp.2.0.0.0\lib\portable-net4+sl5+wp8+win8\MoonSharp.Interpreter.dll.

raV720 commented 7 years ago

When will it be fixed?