Unity Project doesn't have solution file
Solution 1
I finally found the answer.
I closed Xamarin and inside Unity went Assets > Sync MonoDevelop Project Doing this created the two .sln projects: -csharp.sln and .sln
Solution 2
If "Open C# Project" doesnt create the .sln file, try updating your external tools first.
In Unity, go to Edit > Preferences, and make sure that Visual Studio is selected as your preferred external editor.
This created the sln file for me.
Solution 3
For people looking for answers on newer versions of Unity you may have to build your C# project.
To do this go into File > Build Settings then select the option Create Visual Studio Solution. Then build that and your file explorer will ask you for which folder you want your visual studio solution to be placed into. Then Visual Studio should behave correctly.
Related videos on Youtube
Comments
-
aakpro almost 2 years
I just started learning unity and I created a project. But my project doesn't have a sln file included in. Every time I create a C# script and open it in Xamarin Studio I can't have any intellisense.
- Is it normal not to have sln file in unity project?
- If not, how can I add solution file to project?
- Why that happened?
-
Jimbali over 8 yearsOn Unity 5 OS X it is
Assets -> Open C# Project
-
thehelix over 4 yearsOpen C# Project should be it's own answer. There's a problem with my installed version of Visual Studio, so Unity is failing this step. Open C# Project generated the sln for me, I just open it manually.
-
sab669 about 4 yearsIf it is already selected to Visual Studio and you're still experiencing this problem, try clicking "Browse", then select Notepad (or some other application), then set it back to Visual Studio and that should solve the issue.
-
HappyGoLucky over 3 yearsSwitching External Script Editor = Visual Studio Code created the sln for me
-
CPearson over 2 yearsThis was the solution to my problem, (I was unable to pull up solution, and if I opened a C# file, the UnityEngine namespace wasn't recognized. Thanks.