Search Unity

Question code not showing up in visual studio

Discussion in 'Code Editors & IDEs' started by redann9501, Feb 19, 2024.

  1. redann9501

    redann9501

    Joined:
    Jul 10, 2023
    Posts:
    3
    I've been using Unity for a while and I keep having this issue with coding, whenever I go to create a c# script and open it in Visual Studio it's blank this is also only a problem with Unity when I make code in Visual Studio it works just fine. the code shows up in the inspector I've looked up solutions on forums, I've tried building the code into the project and that worked for a while, I've tried regeneration of the code, and I just can't get anything to work. Visual Studio is fully updated and I've looked up solutions, and I'm Screenshot (7).png Screenshot (6).png at my wits end.
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,912
    It's not blank, there's just no file open.

    Make sure Visual Studio is selected in your Preferences -> External Tools. Regenerate project files for good measure too.
     
    Spy-Master likes this.
  3. redann9501

    redann9501

    Joined:
    Jul 10, 2023
    Posts:
    3
    it is open because I just did it again it opens like that, and i tried to regenerate the project files it doesn't work. for some reason Visual Studio just stopped letting me code
     
  4. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Could you try `Window / Reset Window Layout`. Maybe a wrong manipulation removed the code window.