question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile Error 'RuntimeInformation' does not exist in the current context

See original GitHub issue

When I was trying to compile this project at first time with Visual Studio 2015, I ran into these errors.

Error	CS0103	The name 'RuntimeInformation' does not exist in the current context
Error	CS0103	The name 'OSPlatform' does not exist in the current context

And before those errors vs 2015 was asking me for .NET Framework 4.8.

First I was trying to install .NET Framework 4.8, but didn’t solve the errors. https://dotnet.microsoft.com/download/dotnet-framework/net48

Then after few googling, I found this site was helping. https://www.nuget.org/packages/System.Runtime.InteropServices.RuntimeInformation/

So I go to Solution Explorer find this project, right-click, Manage Nuget Package… In the Browse tab, Search “RuntimeInformation” then find the “System.Runtime.InteropServices.RuntimeInformation” Package name, 4.3.0 is the newest for now, and click Install.

Then rebuild, all errors are gone.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
myfingerhurtcommented, Dec 8, 2021

Another problem, STUN from Google not always works very well. Your external IP can't be obtained. You are blocked :-( .\p2p-main\p2pconn\Form1.cs

Need to be able to change the STUN server address, so better to expose STUN server address into the GUI.

1reaction
miroslavpejic85commented, Feb 15, 2022

Good…, No need for port forwarding, being P2P.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Unable to resolve System.Runtime.InteropServices. ...
AspNetCore, I reload the project, and the reference to System.Runtime.InteropServices.RuntimeInformation and System.Net.Htpp are gone. enter ...
Read more >
Compiler Error CS0103
An attempt was made to use a name that does not exist in the class, namespace, or scope. Check the spelling of the...
Read more >
RuntimeInformation Class (System.Runtime.InteropServices)
Indicates whether the current application is running on the specified platform. Applies to. Product, Versions .NET, Core 1.0, Core 1.1, Core 2.0 ...
Read more >
System.Runtime.InteropServices.RuntimeInformation 4.3.0
Provides APIs to query about runtime and OS information. Commonly Used Types: System.Runtime.InteropServices.RuntimeInformation System.
Read more >
Compiling and Executing Code in a C# App - Damir's Corner
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Users\Damir\AppData\Local\ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found