Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve System.Runtime.InteropServices.RuntimeInformation after adding Microsoft.AspNetCore package

Tags:

c#

.net

.net-core

I have encountered the following problem.

I have created a new lib project targeting .net framework 4.6.2 and referenced System.Runtime.InteropServices.RuntimeInformation package via NuGet. (The Object Browser is displaying that that dll has version 4.0.1.0, (in nuget i pointed to instal ver 4.3))

I reload the project, to check if there are no problems with references.

Now I install Microsoft.AspNetCore, I reload the project, and the reference to System.Runtime.InteropServices.RuntimeInformation and System.Net.Htpp are gone.

enter image description here

ps. installing .netstandard package did not help.

Does anyone had a similar problem ?

like image 512
aph5 Avatar asked Jul 20 '26 18:07

aph5


2 Answers

System.Runtime.InteropServices.RuntimeInformation the lowest support .net framework version is 4.7.1. You can see the detail in System.Runtime.interopservices.runtimeinformation

like image 91
doublnt Avatar answered Jul 23 '26 08:07

doublnt


In my case adding

<PropertyGroup>
  <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

to the csproj file helped. I'm still getting missing references, but while running the project I do not get any missing file exceptions

like image 37
aph5 Avatar answered Jul 23 '26 09:07

aph5



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!