Closed Amatsugu closed 8 years ago
I've seen a mono project that works with this library in the past. So I guess it can work. But I haven't tested it and I'm not sure everything works with mono. You can check out the source for Q42.HueApi, build it against mono and maybe figure out what's wrong?
Hi there, i had the exact same problem and was able to solve this with the following steps:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I am successfully running the Api on a Raspberry 2 with mono 4.4.2.
Hope i could help... ;)
Thank you so much, that worked!!! How did you figure out that this was the cause?
Nice, glad i could help! :) I figured it out with a lot of pain and trial and error (setting MONO_LOG_LEVEL=debug and trying to understand whats going wrong), but at the end it was Visual Studio which helped me: there was a warning about different versions of System.Http.Net mapped and a hint to add a binding redirect. Luckily there was an option within the hint to automatically generate and insert this into app.config. Otherwise i wouldn't have known that.. I should have paid attention to that warning earlier on ;) Although i am still not knowing exactly WHY there is this version conflict and how i could have noticed this by myself..
Happy coding...
Thanks, this might help me in the future if I encounter similar issues.
My application is a console application and everything works correctly when running on windows(10), however when I attempt to run the same build with mono I get the following error:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'com.LuminousVector.Karuta.Karuta' threw an exception. ---> System.TypeLoadException: Could not load type 'Q42.HueApi.LocalHueClient' from assembly 'Q42.HueApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. at com.LuminousVector.Karuta.Karuta.RegisterCommands () <0x40df24c0 + 0x00213> in <filename unknown>:0 at com.LuminousVector.Karuta.Karuta..cctor () <0x40dcd5f0 + 0x002ef> in <filename unknown>:0 --- End of inner exception stack trace --- at com.LuminousVector.Karuta.Program.Main () <0x40dccd50 + 0x00033> in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'com.LuminousVector.Karuta.Karuta' threw an exception. ---> System.TypeLoadException: Could not load type 'Q42.HueApi.LocalHueClient' from assembly 'Q42.HueApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. at com.LuminousVector.Karuta.Karuta.RegisterCommands () <0x40df24c0 + 0x00213> in <filename unknown>:0 at com.LuminousVector.Karuta.Karuta..cctor () <0x40dcd5f0 + 0x002ef> in <filename unknown>:0 --- End of inner exception stack trace --- at com.LuminousVector.Karuta.Program.Main () <0x40dccd50 + 0x00033> in <filename unknown>:0
The package was installed via NuGet and I've tried reinstalling, rebuilding as release/debug and nothing makes a difference, it doesn't load on mono. First I should ask if this project normally works correctly with mono and if so, is there a solution to this?
My project is .Net 4.6.1, Console Application, Any CPU
You can find my project here if there's anything you want to double check, and the class specifically that uses this project.