- Home /
Creating new C# script in unity not being added in VS's solution
Every time I create a new script in untiy and open it with VS, I can't seem to find it in its solution, unless I "Reimport All" in unity. This woudn't be a big deal if it managed to find the references to my other scripts and have an intellisense as well. How can I fix this?
Visual Studio doesn't ask you to reload the solution? This is probably a VS issue not a Unity one.
Are you using Unity's "Sync $$anonymous$$onodevelop project" menu item to update the VS solution...?
No, i have follow "configuration" section on second link. Only first time, i clicked "Visual Studio Tools" menu in Unity, then "Open in visual studio" (I don't think is mandatory, by the way). Hower, i followed the guide.
That's all.
Answer by MapuHoB · Feb 10, 2015 at 07:35 PM
I found what the problem is. Wherever there's an error in any of the scripts no matter what error, unity is unable to sync any other scripts, including the one with the error.
That's curious. I definitely don't have that problem as I use the fact regularly (copying a script in Unity, which produces a duplicate classname error, then syncing the project and editing the new file to change the class name outside of unity)
Well that was the case with me. Idk why it acted like this. I also remember that before this happened, unity had been able to sync the project with VS. This time once I fixed all the errors, then I the project started syncronizing.
Answer by giulio-pierucci · Feb 10, 2015 at 03:45 PM
I tried this extension:
https://visualstudiogallery.msdn.microsoft.com/20b80b8c-659b-45ef-96c1-437828fe7cf2
and follow this guide:
http://unityvs.com/documentation/
If I create a new script (from Unity) and double click, VS open it and all seem functional.
Answer by Kun-No-Name · Dec 21, 2019 at 09:21 AM
I'm also have this problem and I knew the reason. It's because I turn off visual studio for unity extension. You can fixed it by select Extensions > Installed > Visual Studio For Unity > Enabled then restart the visual studio. Problem solved.