6

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 ?

5
  • Please include the actual warning from the output window (as text). A screenshot of warning icons is not particularly useful. Sep 4, 2017 at 11:45
  • Which version of visual studio are you using? Sep 4, 2017 at 11:45
  • @MartinUllrich vs 2017 15.3.3
    – aph5
    Sep 4, 2017 at 18:54
  • @MartinUllrich I only found this: Warning The referenced component 'System.Runtime.InteropServices.RuntimeInformation' could not be found. ClassLibrary1
    – aph5
    Sep 4, 2017 at 19:12
  • question has been retargeted more broadly on stackoverflow.com/questions/48520188/…
    – qqtf
    Aug 23, 2022 at 10:21

2 Answers 2

7

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

3

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

4
  • 3
    This may be related to a Visual Studio update, more info here: developercommunity.visualstudio.com/content/problem/95070/…
    – adrian
    Sep 27, 2017 at 14:38
  • 1
    I had an issue using OpenCvSharp with .NET 4.6.2 throwing System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0 and this fixed it. Thank you!
    – p3tch
    Jul 18, 2022 at 14:55
  • @p3tch I have the same problem with OpenCvSharp but I can't fix it, do you have some clue?
    – jæk
    Aug 3, 2022 at 6:40
  • @jæk have you added System.Runtime.InteropServices.RuntimeInformation from nuget? If not, try that
    – p3tch
    Aug 4, 2022 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.