- Home /
How to generate .sln files in Unity 5.2 ( no Sync MonoDevelop Project option anymore)
In the latest version of Unity ( 5.2) there is no "Assets > Sync MonoDevelop Project" in the menu like before, only "Open C# Project".
I use Sublime Text and I need to be able to generate those .sln manually so that OmniSharp reads them and generate Auto-completion and other IntelliSense features for the project. How can I do that?
Answer by kakysha · Mar 29, 2018 at 11:53 AM
It is NOT working for me in Unity 2018 with Sublime Text 3. "Open C# Project" just opens empty file with no name and does not generate anything.
To RE-GENERATE solution (*.sln) and project files you have to:
1) switch back external script editor to Visual Studio 2) Assets -> Open C# Project - at this stage .sln and .csproj should be generated 3) switch back to sublime as external editor.
Do you have Sublime Text set as your external script editor? I haven't checked with 2018 but I always have VS as my external script editor and I open Sublime Text manually. This way it seems the .sln is updated automatically without me having to "Open C# Project" every time.
yes, I do have sublime configured as script editor in Unity, but it seems that it causes some troubles with rebuilding sln and csproj files. $$anonymous$$aybe I should switch back to vs and open sublime manually.
Of course if you don't have Visual Studio (e.g. on Linux), you should set another IDE like $$anonymous$$onoDevelop.
This did not worked for me, I use VS Comunity 2017 as my primary ID$$anonymous$$ I had to open project with Unity 2017, open any scrypt from Unity by double clicking it so it creates solution and than I open project with Unity 2018.
$$anonymous$$wahuNashoba's comment worked for me! I simply opened up my Unity 2018 project with Unity 2017. The .sln project files were generated when opening any script in Unity 2017. Then simply reopen the project with Unity 2018, and it works.
had the same problem while working with visual studio as the editor. had to switch to $$anonymous$$ono Develop -> Open C# Project -> Switch back to visual studio..
This worked for me. Had no .sln file in my new project. So, I switched to VisualStudio in Edit->Preferences->ExternalTools, opened once (VS created me solution), then I switched back to $$anonymous$$onoDevelop and it has .sln file now.
Answer by daklab · Jan 24, 2016 at 06:29 PM
I use SublimeText too.
Assets > Open C# Project
It's worth mentioning that this might appear to have no effect if you're not using VS/$$anonymous$$onodDevelop like SublimeText (I use vim and it just opens vim but doesn't pass a filename), but it does generate the sln file.
Not every day do you see a fellow vim user round these parts.... I am not sure what you meant by it generates sln files. For me I have to initially run Assets -> Open C# Project (have my external editor set as $$anonymous$$onoDevelop just for this purpose) that generates solution files initially and then i just use vim for editing and solution files update automatically by unity. It is a pain this first step, how do you generate solution files??
@localnoob Back then I think I was using Unity 5. I'm now on Unity 2019 and I've come back to find out why my sln is not being generated.
I guess they broke it somewhere along the way.
Answer by Flexford · Mar 16, 2020 at 09:16 PM
I'll just leave it here...
I made utility: SyncSolutionUtilities
Examples:
-Use from editor: Unity menu -> Assets -> Sync C# Solution
-Use from script: SyncSolutionUtilities.Sync(bool logsEnabled)
Screenshot source: https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/$$anonymous$$ono/CodeEditor/SyncVS.cs
(Also, this answer is the best answer.)
Your answer
Follow this Question
Related Questions
Unity 2019.4 Visual Studio not opening! 2 Answers
Visual Studio window pops in front whenever I create or move a C# script. 0 Answers
Why is editor stack when VS2019 attach to unity?,Editor is stack when VS2019 attach to unity. Why? 1 Answer
Open script in existing instance of VS 0 Answers
Unable to integrate Visual Studio 0 Answers