Compile Error 'RuntimeInformation' does not exist in the current context
See original GitHub issueWhen 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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Good…, No need for port forwarding, being P2P.