Search Unity

Unity opens blank visual studio

Discussion in 'Editor & General Support' started by Aggror89, Jan 12, 2019.

  1. Aggror89

    Aggror89

    Joined:
    Sep 16, 2014
    Posts:
    5
    I recently updated to the latest version unity after a year of absence and I now have this issue where clicking on scripts, warnings or errors in Unity opens a blank Visual studio community. Even if the solution is already opened in VS, a new blank version of VS opens.
    • I tried swapping to and from any other IDE via the preferences
    • I tried reinstalling the unity tools in visual studio
    • I tried reinstalling visual studio
    • I tried reinstalling Unity
    Please do not suggest to just use the opened visual studio project. I really want to solve the issue, not work around it. I use 2018.3.0f2
     
    ladenedge likes this.
  2. DemonGamesLab

    DemonGamesLab

    Joined:
    Nov 10, 2015
    Posts:
    9
    Same issue here, did you find a fix? Any script i open up just comes up blank ?
     
    ladenedge likes this.
  3. DemonGamesLab

    DemonGamesLab

    Joined:
    Nov 10, 2015
    Posts:
    9
    Hey, I actually ended up just figuring it out on my end. It will open if you look at the inspector in VS and open the script you want from there.
     
    rricecake likes this.
  4. blanktarget

    blanktarget

    Joined:
    Aug 28, 2017
    Posts:
    20
    Same issue here. I get a blank screen. I can go find the file in explorer and open it there and it's fine, but I can't click any CS file from within unity and have it open properly, which is super annoying.
     
    ladenedge likes this.
  5. DemonGamesLab

    DemonGamesLab

    Joined:
    Nov 10, 2015
    Posts:
    9
    When you open a script in VS minimise VS and double click on your script again. Should work
     
    YM1980 likes this.
  6. mayfas

    mayfas

    Joined:
    Dec 9, 2018
    Posts:
    2
    when i open my script file a blank notepad file is opening but all other script files are opening perfectly in VS. how to retrieve my script file ?
     
  7. Steveiwonder

    Steveiwonder

    Joined:
    Jul 7, 2019
    Posts:
    1
    I have a solution - This is pretty simple, way back when I installed Visual Studio, one of the first things I do is go right click, properties, compatibility and check "Run this program as an administrator" fast forward a year or so where I want to try out Unity for the first time. Launching the Unity Hub and then a new project I tried to open a script file but all that happens is visual studio opens with no project selected.

    It turns out you need to have the Unity Hub and Unity Editor both also run as administrator.

    TLDR (The Fix)
    Set both Unity Hub and Unity Editor to "Run as administrator", Find your shortcut to Unity (hub or not) right click, Properties, Compatibility and check "Run this program as an administrator"

    If you don't have Unity Hub skip that bit.

    NB: If you use the Unity Hub you MUST set both Unity Hub and Unity Editor to run as an administrator for this to work.
     
    MaggieRSeibert and Pale_Josh like this.
  8. HairyBallsagna

    HairyBallsagna

    Joined:
    Jan 12, 2020
    Posts:
    10
    how do i set unity hub as administrator on mac?
     
  9. Pale_Josh

    Pale_Josh

    Joined:
    Mar 4, 2021
    Posts:
    1
    This worked, thanks a ton!
     
  10. Sbu-game

    Sbu-game

    Joined:
    Jul 3, 2020
    Posts:
    1
    Setting both the Unity Hub and the Unity client to administrator rights worked, thanks !
    Just be sure to close the unity hub process from the system tray before proceeding or it may act weird :
    upload_2021-9-18_5-23-49.png
     
  11. MaggieRSeibert

    MaggieRSeibert

    Joined:
    Jun 1, 2022
    Posts:
    1
    Setting Unity to run as admin worked for me!