Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by CrossWiseRanger · Apr 13, 2021 at 07:28 PM · visual studioudpdebugger

Switched to 2020.3.3f1 -- No Debugger and UDP Error,Unable to Use UDP port for VS/Unity Messaging

Was using 2020.3.0f1 without issues. Windows 10, latest VS.

Switched to 2020.3.3f1 and now getting the error:

"Unable to use UDP port 56670 for VS/Unity messaging. You should check if another process is already bound to this port or if your firewall settings are compatible."

The exact port number changes when relaunched. This occurs with a new game, a game that was upgraded, and old games not on 2020.3.3f1.
Debugging in VS no longer works as will not sync up.
How get VS debugger working and no UDP message? ,Was using 2020.30f1 without issues. Windows 10, latest VS.

Switched to 2020.3.3f1 and now getting the error:

"Unable to use UDP port 56670 for VS/Unity messaging. You should check if another process is already bound to this port or if your firewall settings are compatible."

The exact port number changes when relaunched. This occurs with a new game, a game that was upgraded, and old games not on 2020.3.3f1.
Debugging in VS no longer works as will not synch up.
How eliminate the error and get VS debugging operational?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CrossWiseRanger · Apr 14, 2021 at 02:32 PM 0
Share

Additional info.

Deleted all VS files from game. No joy. Deleted from Package Manager VS Editor and Code Editor then reinstalled. No joy. Restarted computer after each action.

Still no joy. Then after numerous attempts to attach in VS, it suddenly started working. But still get the same error in game.

While the game error is UDP port 56222, the VS Attach to Unity shows port 56220. Are the ports settable / selectable in either Unity or VS?

avatar image marce155 · Jul 19, 2021 at 04:49 PM 0
Share

Did you ever find a solution for this problem? I ran into the same issue with 2021.1...

avatar image sascharo · Aug 11, 2021 at 02:51 AM 0
Share

Any solution to this one?

avatar image the_Whizzkid · Aug 24, 2021 at 03:52 PM 0
Share

Same here. 2020.3.15f2 . Some more infos, may be someone has observed similar things: No recent updates, yesterday no such message. I had 2 Unity Crashes yesterday evening where the VB Compiler didn't close in Taskmanager. Afterwards I didn't try to debug anymore. Looked more into it: In my case, my AV "Eset" uses the port. (Check in CMD with netstat -abo -p UDP and look up the Port number. in My case 56238. The find the PID at the end of line. Use that in Taskmanager detail to look up the Process behind that.) So it's not Unity or VS having a fault but using the same port like another connection. It's no solution yet but at least a hint.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by the_Whizzkid · Aug 24, 2021 at 04:24 PM

This solution is "dirty" as it will be overwritten with updates. Handle with care.

Ok, so with the Info of my Comment above: You can change the port Unity is using in case of a conflict. In Visualstudio open the "VisualStudioIntegration.cs" Script. (Just click on the warning in Unity). Change in line 123 (might change in other releases) the Port number like i did. Restart VS and Unity. Unity then uses a higher port number which (hopefully) doesn't conflict with another.

         private static int DebuggingPort()
         {
 123            return 56500 + (System.Diagnostics.Process.GetCurrentProcess().Id % 1000);
         }


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by MikeWise · Nov 20, 2021 at 11:47 AM

Ok, I tried this, with version 2020.3.20f1, in my file the port number was 56000, changed it to 56500, saved it, and ran it and .... it changed back. Quit Unity Editor, changed it again, reloaded, it changed back.

So it didn't work - I guess.

Except here is the wierd thing. The error message "Unable to use UDP port 56214 for VS/Unity messaging" went away. So maybe it did work in some strange inscurtable way?

I don't know. This behavior is flaky but it is probably some flaky Windows-Unity Interaction.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image z3nbstrd · Dec 25, 2021 at 11:41 PM 0
Share

Nothing weird about it. The UDP port number is that constant number, plus the process id of the editor. The process id is assigned by the OS when the process starts, so it will likely be different every time. What really should be done here is they should check if the requested port is in use, and if it is, modify the number and try again. I'm not sure why they aren't doing that here, but the workaround on the user side is to restart Unity so it gets a different process id, and therefore requests a different UDP port.

avatar image the_Whizzkid z3nbstrd · Dec 26, 2021 at 12:27 PM 0
Share

I do agree with all the rest you wrote but: "the workaround on the user side is to restart Unity so it gets a different process id, and therefore requests a different UDP port". No, it's not (always) that easy, I tried to restart unity for 5 or 6 times in a row and some times got the same UDP assigned, or another one which was already in use. Even restarting the OS didn't always help. I also saw that other users had a permanent problem with the error on another thread. Anyways, since I tried my "dirty" solution and wrote my comment I never had the issue again... and also seem to have worked for MikeWise. I know it doesn't make a lot of sense as the script apparently gets overwritten.

avatar image paulygons · Feb 17 at 07:36 PM 0
Share

Same problem, Unity 2021.2.7f1 on Windows 11 (I know, I'm a crazy risk taker). Made Mike's change to "VisualStudioIntegration.cs" Script, it automatically changed back after Unity compiled and warned that the file shouldn't be changed... yet the problem went away for now.

avatar image
0

Answer by justinmp · Feb 19 at 05:04 PM

Here is something interesting... I was dealing with this issue today and was almost done (typing up a big this stinks message) I am on 2021.2.12f1/Windows 10 (full patches) and VS 2019/2022 I kept getting this error even after setting all the firewalls and monitoring it with TCPView (systernals) and could not find any reason why this wasn't working... I reinstalled VS and the unity tools... then I went to my window/package manager and uninstalled the visual studio editor package and noticed that the visual studio code editor package was also installed... removed both reinstalled just the visual studio editor and like magic the message is now gone.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image justinmp · Feb 19 at 05:54 PM 0
Share

Blah, never mind.... open and closed it again, got the same error... and even when I don't get the error Visual studio wont connect anyways giving that "unspecified error"

avatar image justinmp · Feb 19 at 11:43 PM 0
Share

I finally figured out what was causing it, apparently it was vmware, after uninstalling it everything works.

avatar image geronimo_desenvolvimentos justinmp · Apr 06 at 06:22 PM 0
Share

In my case it was VirtualBox, probably is something the virtual machine boxes do on windows

avatar image geronimo_desenvolvimentos justinmp · Apr 06 at 06:22 PM 0
Share

In my case it was VirtualBox, probably is something the virtual machine boxes do on windows

avatar image asperatology · May 19 at 12:50 AM 1
Share

For me, I'm on Unity 2021.3.2f1. All I need to do is to disable all the Windows Firewall rules related to "Unity" (Unity Hub, Unity 2020.3.20f1 Editor, Unity 2021.3.2f1 Editor, etc.), even if the rules themselves are all allowing the connections to go through.

This, paired with Microsoft SysInternals TcpViewer and Resource Monitor on Windows 10 x64 Pro, I was able to confirm Unity no longer shows the warning messages.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

128 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to attach Unity Debugger in VS Code? 3 Answers

Can't attach Visual Studio debugger to iOS device 0 Answers

Weird issues running my game through Windows App Certification Kit? 1 Answer

getting udp package info inside unity (GlovePIE) 0 Answers

Visual Studio 2015 debugger can no longer attach to Unity after installing RC3 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges