Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
myfingerhurt opened this issue Dec 8, 2021 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@myfingerhurt
Copy link

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.

@myfingerhurt
Copy link
Author

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.

@myfingerhurt
Copy link
Author

The Visual Studio error “You are debugging a Release build of p2p.exe. Using Just My Code with Release builds using compiler optimizations results in a degraded debugging experience (e.g. breakpoints will not be hit).”

In Tools - Options window, navigate to General section from the unfolded Debugging tree
In General section , check the checkbox by the name Suppress JIT optimization on module load (Managed only)

@miroslavpejic85
Copy link
Owner

miroslavpejic85 commented Dec 8, 2021

Hello @myfingerhurt, thanks for sharing your valuable notes, much appreciated!

@miroslavpejic85 miroslavpejic85 added the enhancement New feature or request label Dec 8, 2021
@miroslavpejic85 miroslavpejic85 added the good first issue Good for newcomers label Dec 26, 2021
@miroslavpejic85
Copy link
Owner

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.

Added more stun servers: 171947c

@Suleman-Elahi
Copy link

For now, the error is gone. I can connect 2 PCs in LAN but not in WAN. For this to work should port forwarding be enabled? Because my ISP doesn't allow forwarding ports. Is that can be a reason?

@miroslavpejic85
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants