Hi,
I’m trying to install Unity and set all the needed tools including VS Code with intellisense, but Im struggling ith mono and msbuild. Please excuse my bad english, as it’s not my mother’s tongue.
I have managed to install unity hub easily, VS Code, and dotnet and mono sdk extensions. This is what I have done:
To install Unity Hub
flatpak install flathub com.unity.UnityHub
This will allow to install easily releases.
To install VS Code
flatpak install flathub com.visualstudio.code
But we need dotnet and mono which are not included. You can also install flatpak versions, but you’ll have a lot of options… First, the runtime. Yo have to make sure that VS Code runtime matches the one of the extensions. And VS Code, now, uses 22.08 runtime. So when you install dotnet and mono6 you’ll be asked to choose one runtime, so choose wisely as if you dont use the same runtime version, it is not supposed to work with VS Code.
Then, when choosing dotnet version, new problems. We have dotnet (.NET 3.1) and runtime 19.08, so no usable. We have dotnet5 and runtime 21.08, so, again, not usable. We have dotnet6 with runtime 22.08, so we can use this one. But, what does unity have to say in order to have compatibility? Unity will search for a VS Code with dotnet5. So we’ll have to take a look here in the future. We even have a dotnet7 but didnt use it.
To install dotnet6 (remember to select runtime 22.08)
flatpak install org.freedesktop.Sdk.Extension.dotnet6
Mono is “easier” to install as it has only one option, mono6, but it will be a problem later.
To install mono6 (remember to select runtime 22.08)
flatpak install org.freedesktop.Sdk.Extension.mono6
Sonow we have a working Unity Hub, we can install releases easily, and open our files using VS Code. But there are some issues:
-
Unity will complain that we dont have dotnet5 and mono6 in VS Code. But we just cannot fix this as he is searching for 21.08 runtime sdk extensions, but we have installed 22.08.
-
VS Code will claim that he cannot find either dotnet nor mono. Here we can still at least, fix the dotnet part.
We have to set a environment variable when we open VS Code. That is easy to fix using terminal as we just have to add FLATPAK_ENABLE_SDK_EXT=dotnet6,mono6 at the start of the command. But as unity calls VS Code, we have to do something else.
To solve this problem, we will use FLATSEAL (we can install it with flatpak: flatpak install flatseal). Flatseal allows us to manage easily flatpak apps permissions. So we will open Flatseal, choose Code, and go down to environment, and add FLATPAK_ENABLE_SDK_EXT=dotnet6,mono6 there, in ENVIRONMENT, VARIABLES, as a new line.
So next time VS Code is open, he will not complain abput dotnet. Because in order to use mono6 we still need msbuild files which are not bundled in the flatpak. So I’m trying to figure this out.
Unity is usable, VS Code is usable, but not perfect. We have no intellisense, but I think that, hopefully, will be solved with mono6.
Where am I now?
-
I want to fix adding mono6 with MSBuild. I’ve read a post where they manually add all needed files, but haven’t tried that yet.
-
Make Unity stop complaining about VS Code not having mono6 nor dotnet5. This is minor, but still annoying.
-
Make intellisense work.
So if anyone can help me, i would really appreciate it.
Thanks in advance
PS I have tried to use flatpak unity with rider, and dotnet and mono are easily recogniced by rider. But dont know how to make Unity use rider yet. Still I would like to solve the free option so anyone can use it.