Socket errors with Visual Studio integration.
OS: Windows 10
Unity Version: 5.2.2f1 Personal
IDE: Visual Studio Community 2015
I have the Unity Tools plugin installed for Visual Studio, and it is set up as my primary code editor.
Usually, when I open up a project in Unity, and intermittently thereafter, I get the following error:
SocketException: An attempt was made to access a socket in a way forbidden by its access permissions.
System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end)
SyntaxTree.VisualStudio.Unity.Messaging.UdpSocket.Bind (System.Net.IPAddress address, Int32 port)
SyntaxTree.VisualStudio.Unity.Messaging.Messager..ctor (Int32 port)
SyntaxTree.VisualStudio.Unity.Messaging.Messager.BindTo (Int32 port)
SyntaxTree.VisualStudio.Unity.Bridge.VisualStudioIntegration+<>c__DisplayClass3.<.cctor>b__1 ()
SyntaxTree.VisualStudio.Unity.Bridge.Project+<>c__DisplayClass4.<RunOnceOnUpdate>b__3 ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:270)
Other than this, the integration appears to be working fine. The first thing I checked was my firewall settings:
I see Unity and even UnityVS integration stuff in there. So, I'm kind of baffled. Does anyone have any ideas what might be going on?
Hi, did you managed to fix this issue? I'm getting the exact same error in 5.3.2p1.
Answer by diliupg · Jul 02, 2018 at 06:03 AM
3 years on and no answer. Murphy's Law in action. Everybody doesn't know everything..
Answer by Tobychappell · Jul 02, 2018 at 08:04 AM
Sounds like the socket was setup to allow other sockets to share this endpoint (ExlusiveAddressUse) that its binding to but was wanting exclusive access at the same time (SocketOptions) or vice versa, this is hinted from "forbidden by its access permissions."
Answer by TheSlate · Feb 02, 2019 at 08:39 AM
I got this while running on web server on port 3000. Changed the port on the web server and Unity was happy again.
Answer by $$anonymous$$ · May 01, 2020 at 04:25 PM
Bump on this - also having issues!
Your answer
Follow this Question
Related Questions
Tried everything but Intellisense doesn't work VS 2017-2019 0 Answers
Unity not responding after opening script. 1 Answer
A script behaviour has a different serialization layout... 7 Answers
My Unity Editor opens but the window stays grey. Help -.- 1 Answer
SplashScreen for Windows Mobile Universal doesn't show the portrait mode. 2 Answers