- Home /
Is there a way to stop Visual Studio 2012 from requiring a reload whenever new scripts are added in unity?
I'm using Visual Studio 2012 with the Visual Studio tools for Unity plugin.
Whenever I make any change to the Project folder contents in Unity (create a new C# script, rename a script, delete a script, etc), when I click back into Visual Studio, it gives a prompt saying the File System has been altered and the solution needs to be reloaded.
However, clicking the Reload/Reload All prompt never successfully reloads the solution, and I'm forced to close down and restart Visual Studio by opening a script from within unity every time I make such a change.
This is extremely frustrating to my workflow. Has anyone else encountered this, and is there any way to resolve this?
I have exactly the same problem with VS2015 Community and Unity 5.3 personal. Every time I create a new script, a new instance of VS2015 is started. This problem has been raised several times by other users on this forum, but it doesn't get answered or solved.
I don't have this problem, so I don't know if this helps ... In Visual Studio try: Tools->Options->Environment->Documents check 'Auto-load changes, if saved'.
There's no way to prevent the project reload, or to do it automatically. I found that project reloading was very broken in both 2012 and 2013 and would frequently either fail or just crash Visual Studio. I've been using the community version of 2015 with the latest Unity tools with no problems though.
I think this was a bug in one of the Visual Studio versions. Have you tried updating VS?
Answer by Zoogyburger · Feb 18, 2016 at 11:23 PM
It does the same thing for me :( What I do is go to Edit->Preferences from the top-left menu and choose External tools. I switch the External Script Editor to MonoDevelop.
So then how do you use Visual Studio? Just open the solution separately, outside of Unity? Does that break the ability to "Attach to Unity" for debugging using the VSTU plugin?
I don't use Visual Studios because it tries to reload all the time. Ins$$anonymous$$d, like I said in my answer, I switch the Editor to $$anonymous$$onoDevelop. There is not a very big difference between the two.
don´t joke...VS with Resharper has no competitor for that. It would be nice to really find a easy solution for that, which i guess anyways is not on Unity side.
This is a non-answer and is outright counterproductive.
VS is reloading because the environment has changed - Unity edited it. You can make those changes within VS ins$$anonymous$$d, as Dante suggested. I've never had VS crash while reloading - that sounds like the real issue that needs to be sorted out.
Answer by Dante_CyberdeckGames · Mar 07, 2016 at 10:49 AM
If you do not need to add a new folder, simply add new files/classes within Visual Studio by right clicking in the solution explorer on the folder to put the script in and choosing 'Add->Class'.
When you go back to Unity, you will see the new .cs file compile. Visual Studio will not need to reload again.
The downside is that you will need to manually copy over any UnityEngine includes that you need. Not really a big deal to me.
Answer by sr3ds · Jun 21, 2018 at 12:30 PM
When you add a new script from Unity, you shouldn´t open it immediately double clicking in the editor, but you should first go into Visual Studio and let the project to shortly reload. If you do this, you can then open it and have all the references as usual. If you don´t do this, Visual Studio will treat this script as completely external and will not give you access to any of the Unity framework functions, forcing you to close it and restart it.