- Home /
Can't open script via Visual Studio (only last 2 days)
I used to use Visual Studio to edit my c# scripts but last 2-3 days troubles appiears.
When I double-click on c# script, it starts to load Visual Studio, load it, and after 1 sec it dissapears (crash, quit), and then Mono opens.
Now I can edit my c# script only via opening my "*-sharp.sln" in Visual Studio and only THEN open my c# scripts in Unity.
Can somebody help with that issue?
I got used to always open "*-sharp.sln"... it's not a big deal
Answer by A_Vrankie · Jul 13, 2018 at 01:37 PM
I had similar problems, whenever I tried to open a script it would open VS but would fail to open the solution or file. I was able to solve it by starting unity with admin privileges.
Thanks a lot! You saved me from hours of searching for a solution!
As an addition, if you're using unity hub, you need to go to installs, click the the three dots to open your installation in explorer, and then check the "ad$$anonymous$$instrator" option in Compatibility for the exe. After this, you might get an empty error box (red X, but no text) whenever you launch projects from Unity Hub. I was able to fix this by restarting the hub. After this, opening scripts worked from Unity.
Answer by Nems · Feb 10, 2014 at 12:33 PM
It's a common problem, AFAIK the cause in not really identified. Here is a fix: http://answers.unity3d.com/questions/456799/why-unity3d-cant-open-visual-studio-2012.html
P.-S. You should have had searched for your question before ask a new one ;)
Weird... In fact this problem is gone since I have updated to 4.3. But the problem can came up again (it was the case for me on another computer : 3.5 = problem ; 4.1 = problem gone ; after few weeks = problem again). I found out this problem is raised when something is requested to do on VS start-up (like solution conversion...). In that case Unity do not know what to do, so it launch $$anonymous$$D. Another issue is sometimes VS complains about a not recognized projet type when it opens the solution.
It's been a while since I did not see this problem, so I am not sure of what I am saying... sorry.
Answer by Nick4 · Feb 10, 2014 at 11:50 AM
Follow these instructions :
Select MonoDevelop as your default script editor Unity.
Restart Unity.
Re-select your external script editor as default.
Double click on any script you have in Unity to open up Visual Studio.
I had the same problem. Seems simple but I took care of it following those. Good luck
Visual Studio still closes on first second (and after that all another attempts end with opening $$anonymous$$onoDevelop)
Your answer
Follow this Question
Related Questions
How can you modify the default script templates when creating a new script file on Mac 2 Answers
Unity Crash - Project at stand-still 1 Answer
script works and after unity close doesnt work 0 Answers
How do I remove a ScriptableObject reference after the script has been deleted? 0 Answers
What can cause Unity to crash? 3 Answers