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

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?

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);
		}

Any solution to this one?

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.

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.

Raising visibility to @justingmp’s and @geronimo_desenvolvimentos’ comments:

I had both VMware and VirtualBox, and uninstalling both of them solved both the unable to use UDP port for vs/unity messaging and the unable to join player connection multicast group issues.

Any solution to this one?

I think I have potential solution.

During the day I enabled Intel Virtualization Technology in BIOS and I got same issue (warning). I disabled it and now it works without warning.

I run Unity version 2021.3.13f1 (LTS) on Windows 10 pro.

Instructions to BIOS:

My Solution:
Disabled vEthernet(Default Switch) in network.

  1. This issue occurs after I uninstalled VMWare. The vEthernet connection is created by VMWare but not be removed anyhow.
  2. The Unity projects created before VMWare uninstalling have the similar issue.

So I tried to disable the virtual switch and it works.

@the_Whizzkid’s changing port in VisualStudioIntegration.cs doesn’t work for me.