I am trying to migrate on top of an application that I wrote in .NET Core for the .NET Core (Targeting.NET Framework) due to the inability to impersonate the kernel [ from my previous SO ].
I created the application and ported all my Views, Controller, and Models and implemented WebClient as I needed. It works fine on my IIS Express locally, but when I publish to IIS, I get an error:
FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
There are several StackOverflow streams and solutions, but they are all for .NET Core 1.0.1 with the installation of project.json, and they do not migrate well to csproj. Has anyone encountered this error before?
Full stack trace:
System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at TIM.MVC.NET.Startup.ConfigureServices(IServiceCollection services)
I tried installing my application pool both without managed code and with CLR 4.0, and does not affect the error that occurred. I also tried to run
Install-Packem System.Runtime
and it did nothing. I can see the System.Runtime.dll file in the ref folder on the server where IIS is located, and as I said, it works when I run the application in debugging without any problems. Thoughts?