Unity debugger takes years to start the game

First of all, because of the migration, I’m not used to unity dissections, so sorry if I don’t post on the correct “type” of problem.
I’m using version 2022.3.29f1, and Visual Studio 2022.

The debugger has plenty of bugs/inconveniences, the most annoying of them are the ones where I need to wait MINEUTS just to open the game ONE TIME.

After pressing the “Start” button, one of these things will happen.

1. Waiting for unity’s code in __________ to finish executing.

This has three stuff:

A: Unity.plasticSCM.editor.dll

B: unityeditor.coremodule.dll.

C: Waiting for unity’s code to finish executing.

It seems to randomly choose one of these every time. Sometimes it shows, and I can’t use the debugger, and sometimes it lets me to use the debugger, and if I can, after the first frame the message will disappear.

Edit: I have removed some packages, this happens much less, but sometimes it still happens.

https://forum.unity.com/threads/waiting-for-unitys-code-in-unityeditor-coremodule-dll-to-finish-executing.1439128/

2. Unity freezes.

This mostly happens after I press the start button, but sometimes it happens after I press “Attach to unity” button in Visual Studio.

Sometimes, unity will freeze, for minuets at a time. The freeze time depends on how much break points I have.

If I have a lot, it will take A LOT of time, if I have a bit of break points, it will freeze for a few seconds.

Edit: To partially fix the freeze, you can follow this: https://www.youtube.com/watch?v=M_ONTxE0pWg This only solves the problem if the freeze happens after pressing the start button, this still happens but much less. Like I said this can happen pressing “Attach to unity”, for that case it unfortunately does not work. So now the only thing is when unity freezes after pressing the “Attach to unity” button.

I just think it is ridicules I need to wait about 3 minuets, just to open the game once.

These things only happen while in the debugger.

Please, if you know why this happens or how to fix even one of these, I will very apricate it.

You could try installing the trial for Rider to check if that works better with attaching the debugger. Just to see if this is a Microsoft issue, or a general “attach debugger” issue.

Also, sometimes all it takes is to reboot. Or clean the system. If you have a long history of various IDEs and SDKs being installed and uninstalled from the system plus loads of background processes running, a cleanup if not clean install might help.

Also consider security monitoring programs like antivirus or the sort of monitoring tools you find in corporate environments, particularly the latter had caused some debugging issues for me many many years ago.

I have flashbacks from this sort of thing.
I got a new computer recently, and Visual Studio 2022 will not connect with unity.
I did the edit-preferences-External tools, but it just didn’t work(yes I pressed the “regenerate project files”)
But I’ll try visual studio code because I have it already

VScode actually works, but I still prefer VS. There must be something I can do for VS.

Note that VS Code is not an officially supported IDE. The reason is quite simple: it’s not an IDE, it’s a container application for all sorts of plugins which never get tested in the combination and versions that each individual user uses.

It’s basically a self-maintenance solution that may work well, or not at all, or every once in a while annoy the hell out of you.

Not that VS isn’t much different. The problem with the Microsoft IDEs is simply that they’re created and maintained for business application developers first and foremost. The game developers are just a fringe bunch for Microsoft, one of several niches they cater to, so their Unity support will always be sub-par compared to Jetbrains’ Rider.

Does it not being an IDE matter? The debugger still works.
I have never said that now I will use VS code instead of VS, I still think that VS is better, but it was only to see, just like you said, if it is a problem in VS or a general problem, and I saw that it is a VS problem.
I just don’t think that VS code not being an IDE really matters, right?

It matters in so far, to me at least, knowing that VSCode is an inferior solution to VS and there‘s a certain trend among some developers to choose ‚lighter‘ tools, giving up or depriving oneself of learning the many benefits a fully integrated solution offers.

Refactoring for example. The amount of refactoring I can do automatically with Rider compared to VS was an eye-opener and huge time saver. VS doesn‘t offer nearly as much and it only gets worse with VSCode. Can those automatically add an assembly definition reference merely by starting to use it in your code? Last time I checked they weren‘t even aware of Unity‘s Assembly Definition concept.

So yes, it‘s a lighter tool and it‘s the only free choice on Linux. But if one is working with Unity and gets compensated for doing so, it would be counterproductive not to use the best available tool.

I understand that VScode is infirior to VS. And I still use VS, not VS code

I only did it to check if it works. I didn’t give up on VS, I simply checked, like you told me, if the problem is with VS, or bigger than that.
I know that “escaping” to VS code and stopping using VS is not a solution, that is why I didn’t to that.