Unity always open VS2010 instead of VS2012

I installed VS2012 first, and successfully intergrated Unity with VS2012 (by selecting devenv.exe path). After that, for some reasons, I installed VS2010. Now I can only open Unity scripts in VS2010, even if in Preference, I selected VS2012 devenv.exe path, and the preferences dialog show I have selected VS2012.

alt text

How can I revert to editor to VS2012?

6 Answers

6

I have Visual Studio 2013 installed, and after installing SQL Server 2014 with Tools, Unity had problems with starting VS2013 as shell for project editing with infamous “Invalid license data. Reinstall is required.” popup

After getting frustrated Nth time, and hours spent on internet in search for answers, and finally getting it traced with friendly Process Monitor it came up to this:

Unity (or something inside it, I don’t know, may be some COM object), when it attempts to start a handler for the Visual Studio, traces all the versions of VS from lower versions up in registry keys HKCR\VisualStudio.DTE.xx.0 in order to figure out what handler to run. I went to my registry and just disabled VisualStudio.DTE.10.0 entry by renaming it to “VisualStudio.DTE.10.0 disabled” and everything magically works now.

(vs2010 was not a full version of Visual studio anyway in my case - it came with SQL Server 2014 as Management Console replacement and screwing things ever since it got installed.)

(I originally posted it here but it looks like this question is also fits for my findings)

Great work, I'll give this a shot.

Thanks! The only solution that worked

I have the same problem. I installed the VS2010 shell and now when I click on C# scripts in Unity it opens 2010 and says that I don’t have the registration key. Then opens MonoDev.
I also have VS2012.

I looked at:

I am having the exact same problem… Since Unity did not show Visual Studio 2012 in the list I pointed it towards the devenv.exe, but it always opens a Visual Studio 2010 shell saying “Invalid license data. Reinstall is required.”

The way I “solved” it was by going to the Unity project folder and manually opening the .csproj file.

This contains all the information of the C# project and will register changes as you add scripts in Unity.

So this way I just keep VS2012 and Unity open at the same time…

Just make sure not to alter the project settings in VS2012, as I am not sure what consequences that would have in Unity.

I had the same problem, one way to fix it is to set Visual Studio 2012 as default editor for “.cs” files

This did not work for me.

I also had the same problem. For me it was fixed by installing the Visual Studio Unity tools (http://unityvs.com/), and then importing the required assets to my project (Assets → Import Package → Visual Studio 20xx Tools).

To add another Version of Visual Studio use the

Edit → Preferences → External Tools

Then in the drop down select browse and navigate to the devenv.exe you want it to run. I just did this with VS2017 and it picked it up fine after showing it where the file is.
Before it was loading that stupid 2010 thing ;(