I recently downloaded the latest Unity for evaluation purposes and it seems great. Although Mono Develop seems pretty good, there are enough quirks when using it that I opted to try Visual Studio Express instead (i.e., either Visual C# Express or Windows Desktop Express).
There are many threads on these forums wondering how the integration between Unity and Visual Studio Express could be better. Instead of replying to all those threads, I decided to create this one.
I have developed a simple application that acts as a middleman between Unity and Visual Studio Express. Although not perfect, it is able to open a project in Visual Studio Express when you double-click on a script file in Unity. In other words, the project doesnât already need to be open in Visual Studio Express for this to work. It is also able to go to the correct line number in Visual Studio Express if you double-click on an error in Unity.
I hope it is helpful to some of you - tell me if you have any problems with it. The source is on github:
Express limitation seems to be. I thought it was a Unity free or pro issue, but in the Docs you can read: 2) Unity automatically opening VisualStudio when you doubleclick on a script, or error in Unity. Works with Professional only.
I donât have VS Pro at home, and it still opens VS Express when I click a script. They list two way to setup VS Express vs VS Pro, and yet you can do the same for both.
Thatâs the way I did it with VS Express, and it works.
yes its the same way I did it. However if you doubleclick a script or error message inside Unity it will always open a new Visual Studio instance, it will not go to line (in case of error), and it is not your VS solution that gets opened only, the script itself.
Normally I sync my Unity Project ( Assets â Sync MonoDevelop Project ), to get my VS solution up and running âŚ
does it open the current solution when you double click on a file in unity? or does it open in a new instance like element_wsc described?
does it jump to a file and line when you double click on a error/debug log entry in unity?
which express version do you use?
Please tell me the issues you are having with the UnityVSExpress application. There are some cases where it will not work, but most of the time it does. For example, if you have no Visual Studio Express open, the application should open a new instance of Visual Studio Express and open your solution and file. If you already have a Visual Studio Express instance open, it should open the file in that instance. Note that if you have multiple Visual Studio Express instances open, then it is not guaranteed which instance the file will open in.
If this behavior is not what you are experiencing, then please give me more details.
PS - Sorry for the late reply - I am new to this forum and wasnât subscribed to this thread. Iâll be more responsive in the future.
Well itâs opening the project rather than just the file (a part of which is the instance management stuff) and itâs got go-to-line support for log messages.
One more thing. The UnityVSExpress app wonât work properly if you already have an instance of Visual Studio Express up and running that is not open to your Unity project. Iâll see if that quirk can be eliminated, but for now thatâs how it is.
if your tool is capable of all those functionality it seems that the unity to vs-express limitations mentioned on the site linked by Pablo SĂÂĄnchez are not VS inherent. so i wonder why UT does not support it out of the box.
anyway good work and its surely a help for many devs as these limitations are the only reason (beside the debug thing) to not use visual studio express for developing. and as monodevelop has grown to a serious nightmare from what i read there is dire need for an alternative.
While there are a few known workarounds, I think that doing it via the official SDK is VS dependent. So itâs perhaps that Unity canât do it in any way that they can officially support?
And while this is a significant improvement over the built in Express usage (which treats it like a dumb text editor), from what I see it still has issues that may only be solvable with the official SDK that kind of rule it out as being an official feature anyway (like loading multiple instances if you donât use it exactly right).
It doesnât go to line on professional either after it has initially opened a script.
You have to wait till it has opened, then click the error message again in unity and it will go to line.
Are you saying with express it just keeps opening new instances of VS for the same script?
For anyone having problems with the UnityVSExpress app opening new instances all the time, make sure you specify the Visual Studio Express year as the third parameter and see if that fixes anything. Currently, the app defaults to 2010 (i.e., Visual C# Express 2010). For example, if you are using the latest Visual Studio Express (Windows Desktop Express 2013), then your external editor args in Unity would be:
"(File)" (Line) 2013
Note that you still canât debug using Visual Studio Express. However, if you need debugging you can switch back to Mono Develop temporarily. At least that is what I was planning to do.
The UnityVSExpress app is really just a quick hack intended to make Visual Studio Express work a little better with Unity. It is definitely not up to snuff in terms of being an âofficialâ solution.
This works great! Using it with Visual Studio Express 2012. I did make some small changes to the source to fix the fact that this tries to open the full Unity solution (which includes *.unityproj files that VS canât open). Now it opens the [ProjectName]-csharp.sln; it worked before anyway, but this at least gets rid of the error message the first time you open it.