Trying to get Microsoft.Rest working in Xamarin

DenisBarnardDenisBarnard USMember ✭✭

I am using Microsoft.Rest.ClientRuntime 2.3.6 and am trying to contact my API via an auto-generated REST API Client. I have the code running from my desktop application so the API side of things is fine. Xamarin is giving me grief and I don't know where to go from here. Any ideas?
I get the following error. I have tried removing dependencies and reading them. Cleaning solution. Restarting VS 2017 etc.

"System.IO.FileNotFoundException: Could not load file or assembly '/storage/emulated/0/Android/data/B2i.Mobile.Android/files/.override/en-US/Microsoft.Rest.ClientRuntime.resources.dll' or one of its dependencies"

Best Answer

  • DenisBarnardDenisBarnard US ✭✭
    Accepted Answer

    Ok, well to follow up on this awesome adventure of mine...

    I have recreated just my Xamarin project(s) in VS2015 and linked them all to the same NuGet packages I had in my VS2017 attempts.
    I then added references to my other existing VS2017 projects to the new VS2015 Xamarin project ... and it all works fine. Of course it does.
    I now open the whole solution up in VS2017 and it still works.

    A big waste of productivity there, diarised here to potentially help the next poor soul who encounters it and hopefully save them some time.

Answers

  • DenisBarnardDenisBarnard USMember ✭✭

    Urgh. I am still having issues with this.

    Visual Studio 2017, C#.
    Create a blank portable project, Add REST API Client, the Swagger works fine.
    Create a new cross-platform Xamarin.Forms app, portable.
    Try and use the auto-generated REST API Client from the Xamarin app, get error.

    I have the exact same code running in a WPF app and it works fine. Seriously tearing my hair out :/

  • DenisBarnardDenisBarnard USMember ✭✭

    Omg, it works on VS2015. Exactly the same steps.
    God damn this development environment is excruciating.
    I have lost so many hours because of this, and still can't get it working in Xamarin VS2017 (as mentioned above, WPF is fine).
    I have checked all of my NuGet versions, recreated all of my projects with just the bare minimums etc.

    I am also out of my depth, I don't even know where to begin digging deeper into this FileNotFound exception.

    I think its time for bed.

  • DenisBarnardDenisBarnard USMember ✭✭
    Accepted Answer

    Ok, well to follow up on this awesome adventure of mine...

    I have recreated just my Xamarin project(s) in VS2015 and linked them all to the same NuGet packages I had in my VS2017 attempts.
    I then added references to my other existing VS2017 projects to the new VS2015 Xamarin project ... and it all works fine. Of course it does.
    I now open the whole solution up in VS2017 and it still works.

    A big waste of productivity there, diarised here to potentially help the next poor soul who encounters it and hopefully save them some time.

Sign In or Register to comment.