I need to create ASP.NET CORE 2.1 web API from one class that is in Class library project(Targets 4.7.2).
I have added references to Microsoft.AspNetCore and Microsoft.AspNetCore.Mvc.Core.
Following call throws exception:
CreateWebHostBuilder().Build().Run();
Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Output window:
Exception thrown: 'System.IO.FileNotFoundException' in Microsoft.Extensions.DependencyInjection.dll
An exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.Extensions.DependencyInjection.dll but was not handled in user code
Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I have tried adding System.Runtime.InteropServices.RuntimeInformation reference manualy with no success.
Am I missing something here?