I am working on porting an "ASP.NET Core Web Application" that was compiling under the .NET Framework 4.6.1 (i.e. full framework) over to compiling against .NET Core 2.0. I have some dependencies which still require the full framework but with .NET 2.0 my understanding is that I can now reference full framework assemblies from within a .NET Core 2.0 compiled application.
When I attempt to run the project, I get the following error:
Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
I looked through all the NuGet packages and projects I'm referencing and none of them reference System.ServiceModel.Web but I'm not convinced that's the same as the System.ServiceModel. When I open the projectname.deps.json file located in the bin folder, I see a reference to System.ServiceModel.Web but no reference to System.ServiceModel under the "Microsoft.NETCore.App/2.0.0" section which contains the following line: "ref/netcoreapp2.0/System.ServiceModel.Web.dll": {},
I also poked around in the "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.0" folder and I see a System.ServiceModel.Web.dll.
I'm not doing any WCF work and as I stated I've looked at all the dependencies of the libraries I'm using and none of them appear to be referencing System.ServiceModel.
Has anyone else run into this issue? I appreciate any and all insights anyone might have.
I solved this problem installing the Nuget package:
Install-Package Microsoft.Windows.Compatibility
I was using ASP.net Core 2.2 but maybe works for 2.0v too
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With