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
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.
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.
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 :