You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nick Jensen edited this page May 3, 2020
·
1 revision
Project files
Unity3D uses the .NET Framework, not .NET Core (dotnet) for its engines. It has its own internal way of building projects and only generates .csproj files on demand. Without the .csproj file, Unity code cannot be understood by OmniSharp-roslyn, the language server used by OmniSharp-vim and VSCode.
Unity only automatically generates .csproj files when configured to use an editor it knows. For example VSCode. If the name of your editor is not whitelisted, the files do not get generated.
You can force the generation of those files like this in Unity 2019.3:
Go to Preferences -> External Tools
Set "External Script Editor" to "Open by file extension"
Check "Generate all .csproj files"
Close unity
Run the following command in your project folder to force the generation of the project files, even if you don't have VS Code installed:
(You may need to adjust the path to /opt/Unity/Editor/Unity depending on your installation)
Now the project files should be generated
MSBuild location
roslyn/OmniSharp-roslyn may not find the correct msbuild location necessary for running .NET Framework projects. The msbuild shipped with OmniSharp-roslyn (as part of its local mono) does not contain all reference assemblies. The recommendation is to install the latest version of mono for your system, and then set environment variable FrameworkPathOverride to point to it:
export FrameworkPathOverride=/lib/mono/4.7.2-api
Alternatively, set the variable only for your vim session:
FrameworkPathOverride=/lib/mono/4.7.2-api vim Program.cs