Search code examples
c#dlluwpxamarin.formsurhosharp

UrhoSharp Xamarin.Form - Unable to load dll 'mono-urho'


I've impelemented custom control for my Xamarin.Forms project and I have problem trying to start UrhoSharp engine for UWP platform.

The issues arises at Run() method called on UrhoSufrace control:

// this _engine object is my custom object with some application options
Control.Run<SceneEngine.EngineApplication>(_engine.EngineApplicationOptions);

There is similar question already but it does not solve my problem.

The exception I get: Unable to load DLL 'mono-urho': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

 at Urho.Sdl.SDL_SetMainReady()
 at Urho.UWP.UrhoSurface.Run(Type appType, ApplicationOptions options)
 at Urho.UWP.UrhoSurface.Run[TGame](ApplicationOptions options)
 at IM01App.UWP.Controls.Engine3dRenderer.<OnElementChanged>d__2.MoveNext()

I've already tried to use different verions of UrhoSharp.

I've also checked if the mono-urho.dll file exists and it can be found in the UWP project directory at bin\x86\.


Solution

  • So the problem was such that the path to the mono-urho.dll had spaces:

    UWP\bin\x86\UWP - Visualization only\mono-urho.dll
    UWP\bin\x86\UWP - Visualization only\Urho.dll
    UWP\bin\x86\UWP - Visualization only\AppX\mono-urho.dll
    UWP\bin\x86\UWP - Visualization only\AppX\Urho.dll
    

    I had configuration with name: UWP - Visualization only. Changing it to: Debug solved this issue:

    UWP\bin\x86\Debug\mono-urho.dll
    UWP\bin\x86\Debug\Urho.dll
    UWP\bin\x86\Debug\AppX\mono-urho.dll
    UWP\bin\x86\Debug\AppX\Urho.dll