Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Game won't play in Editor with Visual Studio attached

Discussion in 'Editor & General Support' started by d11kriverwood, Sep 16, 2022.

  1. d11kriverwood

    d11kriverwood

    Joined:
    May 25, 2021
    Posts:
    2
    I'm using Visual Studio 2022, and after I attached it to Unity, when I press 'Play' the game won't start but Unity will infinite be loading it. This also happens when saving a script change with it attached, when Unity attempts to 'Reload Asset Dependencies' it just gets stuck.

    Is there a solution to this? 2019 did not have this issue but was running too slow for my project.
    I've selected bug as this is how it feels, but if there's an option I just need to turn off that would be great.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    29,725
    Usually this is some issue with Visual Studio where it just can't set the breakpoint and holds up the process from launching forever.

    Check the integration with Unity, update everything, and also try rebooting your computer.

    This may help you with intellisense and possibly other Visual Studio integration problems:

    Sometimes the fix is as simple as doing Assets -> Open C# Project from Unity. Other times it requires more.

    Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

    Barring all that, move on to other ideas:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

    Also, try update the VSCode package inside of Unity: Window -> Package Manager -> Search for Visual Studio Code Editor -> Press the Update button

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
    MartinTilo likes this.
  3. d11kriverwood

    d11kriverwood

    Joined:
    May 25, 2021
    Posts:
    2
    Really helpful tips there - thank you!
     
    Kurt-Dekker likes this.