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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

I can't open the scripting program.

Discussion in 'Editor & General Support' started by Coconutbutt, Mar 14, 2021.

  1. Coconutbutt

    Coconutbutt

    Joined:
    Mar 14, 2021
    Posts:
    3
    So I just downloaded unity and was watching a tutorial and they double clicked a 'C# Script' asset and "Visual Studios" popped up and they explained that it downloads WITH unity. but when i double click the assest it windows says "how do you want to open this file (.cs)"

    Do I have to download something else or am I doing something wrong.
     
  2. MlleBun

    MlleBun

    Joined:
    Sep 19, 2017
    Posts:
    163
    Atomi_63 likes this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
  4. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    569
    Every time I download Unity, for some reason I need to tell it to use the Visual Studios instance. I **think** that is because I already have Visual Studios, and don't download it along side Unity. But you can tell it to use Visual Studios by going to Edit > Preferences > External Tools and select the Visual Studios instance you want C# files to open in. I am pretty sure this is the problem you are having, as I've had it before. That should fix it.
     
  5. Coconutbutt

    Coconutbutt

    Joined:
    Mar 14, 2021
    Posts:
    3
    I've been trying but.
     

    Attached Files:

  6. Coconutbutt

    Coconutbutt

    Joined:
    Mar 14, 2021
    Posts:
    3

    It says its up to date, but i dont know how to update it or if i even downloaded it at all.
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,780
    Not sure where this is going wrong, but try exiting Unity and just doubleclicking on a *.cs file in your file explorer window.

    Maybe from the you can do "OpenWith" and force it to be VS always, it might work.

    I think if you can get THAT to work (eg, open Visual Studio) from the computer OS, then Unity's will also be working.
     
  8. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    569
    Click "Browse" and go to your programs folder, and look for the VS executable. Select that, wherever it may be. Google for where the .exe is stored, if necessary.
     
  9. cosminpc96

    cosminpc96

    Joined:
    Jun 18, 2021
    Posts:
    1
    Check if you have Visual Studio set to run as administrator from the troubleshoot compatibilities. Go to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE and look for devenv.exe -> Right Click -> Troubleshoot Compatibilities -> Troubleshoot Program -> check if the checkbox "The program requires additional permissions" is checked. If it is, uncheck it, finish the troubleshooting, and that should do it.
    I had Visual Studio installed before installing Unity. And for my job i'm doing a lot of debugging with it, so I set it up to "Run as administrator" from Troubleshoot Compatibilities. As soon as a realized, i unchecked it and mira-magically it works (mentioning that i've been struggling with this for a couple months now). Now i run it as an admin just from the shortcut, not from any place. :D
    Hope it works for you as well.
     
    jjfawkes likes this.
  10. jjfawkes

    jjfawkes

    Joined:
    May 28, 2013
    Posts:
    12
    I can confirm that this fixed my issue with opening VS.
    I had set it up to be opened by default as administrator, once I removed that setting, Unity was able to launch and synchronize with visual studio.
    Note, if you look under devenv.exe properties, run as admin will NOT be checked, this is a hidden setting that is changed by the troubleshooter as explained above.