Self-contained Asp.net core (1.0.1) app cannot find RestSharp dll

0

I have an ASP.Net Core (1.0.1) web app. One of the packages it consumes itself consumes RestSharp. When built, the RestSharp dll is indeed in the app root. But when I deploy and browse to the app, I get the following error:

Application startup exception: System.IO.FileLoadException: Could not load file or assembly 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=8d483824b1b4e30c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=8d483824b1b4e30c'.

Let me be clear, here... the dll is the correct version: 105.2.3.0.

Now, if I register RestSharp to the GAC, all is well and the website works. But this is a .Net Core self-contained app and it shouldn't be looking in the GAC at all (should it??).

I'm really lost and confused. I honestly don't know what's going on, so I really could do with some help.

App folder after publishing:

MyApp/
    MyApp.exe
    ....
    ....
    etc.
    RestSharp.dll (v105.2.3.0)
    web.config
    appsettings.json

UPDATE: Sorry, I should have also mentioned that I'm targetting net46.

asp.net-core
.net-4.6
asked on Stack Overflow Oct 11, 2017 by Tony • edited Jan 15, 2019 by ekad

1 Answer

0

As mason rightly pointed out: You said "This is a .NET Core self contained app". But that's not true if you're targeting .NET Framework 4.6.

answered on Stack Overflow Jun 21, 2018 by Tony

User contributions licensed under CC BY-SA 3.0