Error detecting Visual Studio installations

Using Unity 2019, I am getting the error below in the console on a fresh new project. Have tried reinstalling Visual Studio and Visual Studio Tools for Unity using the VS Installer. Have gone into preferences in Unity, and the external editor was not set, so have set this to the devenv.exe in my VS installation folder. Have googled around and can’t find any other advice!

Anyone able to help? It doesn’t flag as a critical failure, and double clicking a script in Unity does open it in VS. However, when I edit scripts in VS I don’t get autocomplete working and prompting me with Unity code, which Ben always gets in his lectures. Am guessing this error might be why?

Would really like to fix it, all help gratefully received!

Thanks.

Error detecting Visual Studio installations: ApplicationName=‘D:\My Documents\Matt’s Files\Unity Course (Udemy)\Test\Library\PackageCache\com.unity.ide.visualstudio@1.0.5/Editor/VSWhere/vswhere.exe’, CommandLine=’-prerelease -property productPath’, CurrentDirectory=’’, Native error= The system cannot find the file specified.

at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in :0
at System.Diagnostics.Process.Start () [0x0003a] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at VisualStudioEditor.VSEditor+d__1.MoveNext () [0x00106] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\Test\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:57
at System.Collections.Generic.LargeArrayBuilder1[T].AddRange (System.Collections.Generic.IEnumerable1[T] items) [0x0005e] in :0
at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable1[T] source) [0x00033] in <b7efe7e6e548497fac3c4a6049a0a4b6>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in :0
at VisualStudioEditor.VSEditor.GetInstalledVisualStudios () [0x00099] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\Test\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:231
at VisualStudioEditor.VSEditor…cctor () [0x00022] in D:\My Documents\Matt’s Files\Unity Course (Udemy)\Test\Library\PackageCache\com.unity.ide.visualstudio@1.0.5\Editor\VSEditor.cs:70
UnityEngine.Debug:Log(Object)
VisualStudioEditor.VSEditor:.cctor() (at Library/PackageCache/com.unity.ide.visualstudio@1.0.5/Editor/VSEditor.cs:74)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type)

Hi,

In which course are you? If it’s the 2D course, please watch lecture “Fixing Visual Studio Problems” (currently #16).

Hi there. No, I am currently doing the 3D course, working through Argon Assault project. I will go and check that lecture out anyway though…

Which version of VS do you use? And when exactly did the error appear?

Make sure that VS is not installed in the same folder as Unity or a Unity project. In Unity, select Visual Studio selected as your External Script Editor (Edit > Preferences > External Tools).

I am using VS 2017 Community v15.9.12. It is as installed by Unity and installed in the default location (not same folder as Unity or a Unity project).

Have now watched the lecture you referenced, and of the 6 points Rick mentions, I have already done 5 of them to no avail.

The one that I cannot follow is checking my script is included in the project with VS Solution Explorer.

When I go to this, I get a blank list under the top level, not all the files like Rick has in the video. Guessing this must be the issue, but no idea how to fix! It is not that the script is not “included” in the project like Rick outlines. I just have nothing showing up in the Solution Explorer.

Any ideas?

Thanks a lot for the super quick replies!

Do you have a firewall or an antivirus program that could be blocking Unity?

You could also follow these official instructions:

I don’t believe so, Asset store works fine. But I will look at that. Will also check the MS instruction page you linked. I just tried installing Unity 2019.1 to see if that helped - I was on 2019.3, which I now realise is an Alpha version - but it doesn’t seem to have.

Thanks again for your suggestions, will look at this again later or more likely tomorrow, have to pop out now…

So I have checked the MS page, but found nothing to help on that. I have reinstalled VS, but still no luck.

To test the issue further, I have now tried creating new projects in Unity 2017.3, 2018.3, 2019.1 and 2019.3. From this I have found it is only 2019.3 that gives the problem on a new project. The others all work fine - the project opens without the VS installation detection error, when I create a script and open it in VS I get Unity command autocomplete working and I get a proper structure in VS Solution Explorer.

When I create a new project in 2019.3, I get the same issue - the error when I open the project, no Unity command autocomplete in VS and an empty structure in VS Solution Explorer.

I have tried uninstalling and reinstalling 2019.3, but this did not help.

Would really appreciate any other help… is this just a Unity 2019.3 issue?

If I try to open my 2019.3 project in 2019.1 I get a message about risk of this “downgrade” messing my project up, anyone know if this will cause a problem!?

Thanks!

Make a backup of your project folder by duplicating it. Then install stable version of Unity and open your project in it. Generally, it’s never a good idea to work on a real project with an alpha version.

Yes, I have learned that!

I tried downgrading a copy, and it made a right mess. I have started again in 2019.1 as the latest “f” release. Fortunately I had not got massively far into the project. Probably only 2 or 3 hours work to get back to where I was…

Thanks for your help.

If you did what Rick did, you could go to your current lecure, then on Resources > Lecture Project Changes and download Rick’s project state from GitHub.

This topic was automatically closed after 14 days. New replies are no longer allowed.