How can I get Unity running with VSCode as editor on Manjaro?

I am trying to use unity C# with VSCode on Manjaro, and I keep getting an error about not having DotNetFramework v4.7.1 installed. I googled that error and found this article-

which says that on Ubuntu, this issue is solved by installing mono-complete. We have no such thing as mono-complete on Manjaro/arch, only Mono, and I already had that installed. What is the equivalent?

Try installing mono-msbuild too

How are you trying to install it? I have installed that in the past from the aur and it all went smooth. Normally it will install the dependencies you need at the same time it will install the entire thing if yay behaves correctly. I will try it later myself to make sure the aur script didn’t go bad.

I just typed in yay -S mono-complete and no package was found.

That didn’t help

Did you install code oss from the repo or the aur one?

https://aur.archlinux.org/packages/visual-studio-code-bin

Some stuff will not work with the oss one.

https://wiki.archlinux.org/index.php/Visual_Studio_Code#Error_from_OmniSharp_that_MSBuild_cannot_be_located

Because mono-complete isn’t what it’s called in arch the package I installed was mono-develop but that’s the entire IDE. Try mono-stable that sounds like it’s what you want. If that falls to install do mono-git.

Ditto to @moson question. For the sake of it working and not being experimental I recommend installing the closed source version.

@LinuxLoverForever that didn’t help- still the same error.

I remember I took rounds with the mono PKGBUILD - I just don’t remember which.

It turned out I need to run a sed against the source because of some paths in the source pointed to paths which do not exist on Arch based systems.

I remember talking to the maintainer - which argued that this was not a problem for the maintainer but an upstream issue - and it was pretty much it.

I think - without being able to verify - you could be facing a similar issue. My issue was roughly the same - msbuild could not be located. I can’t say if the PKGBUILD or the source has changed since.

I found the package - I took rounds with - it was monodevelop-stable - but is was many moons ago [1][2][3] and I have since settled on using a virtual Windows 10 with Visual Studio 2019 community edition.

And for the projects I am involved with - this solution works for me.

1 Like

Can you post the error message? I will replicate on my machine what I suggested that you do to see if I can make a C# hello world program.

Oh- this is specifically for Unity with C#. C# works fine on it’s own. The error is as follows-

Error: The reference assemblies for framework “.NETFramework,Version=v4.7.1” were not found…

Exactly as in the article.

I see what you mean I didn’t realize mono didn’t do the job I’m still trying to figure out how to get C# working in vs code myself I will post back when I get it going.

@SpaceGuy99

I made progress but can’t really work on it today but I’ll try to work on it later tonight or something. If you need to do work in that language ASAP I recommend using a Windows virtual machine for the time being it’s things like these that show that Microsoft is not as linux friendly as they claim to be

Alright- thanks. It’s not that urgent but I would love to get this working

Could you try:

sudo echo "FrameworkPathOverride=/lib/mono/4.7.1-api/" >> /etc/environment and reboot.

1 Like

That article is either rather uninformed … or chooses not to be informative.

So … what exactly provides this thing you want?

From what I can see … its owned by regular package mono
(and then tangentially in a number of wine and unity packages and such)

ex (dumbed down command for minimal output):

$ pacman -Fxq usr/lib/mono/4.7.1-api
extra/mono

But maybe … that is not where {insert whatever you are doing} is looking for it…
(or maybe it cant because you are doing so in wine or something similar … IDK)

@moson

Please do not suggest this. It is destructive.
ex:

$ echo "hello" > test.txt
$ cat test.txt
hello
$ echo "goodbye" > test.txt
$ cat test.txt
goodbye

(as in … your command will wipe out anything currently in /etc/environment)

It is almost always preferable (especially in a default existing system file) to use
echo 'text' | tee -a file.txt
ex:

$ echo 'lets be friends' | tee -a test.txt
$ cat test.txt
goodbye
lets be friends

( in the case of sudo then echo 'lets be friends' | sudo tee -a test.txt )

No it isn’t. It will append >>…

haha.
2 > or >>
oops… forgive me :stuck_out_tongue_winking_eye:

well … teaching moment then … kids, make sure to use >> for appending (adding) !

Though … I still feel the tee method is preferable.

1 Like

No prob. I first thought the same as well when i was reading that reddit post (man that guy is wiping the environments file) until i saw it two > :joy:

1 Like

So one typo of > vs >> and it becomes destructive? I’d rather skip it altogether. Also if anyone wants to beat me to it in solving OPs issue please feel free I’m beat from work so I don’t plan on working on it tonight. As you know OP is trying to run a c# program via vscode which actually requires donet-runtime and dotnet-sdk. (not mono) I got closer after installing those to things and switching to the proprietary vscode because unlike the OSS version the proprietary one gave meaningful errors but instead of searching them I stupidly skipped over them. Even with adding the configuration the arch wiki has vscode still considers the launch.json file incomplete.

I think the launch file looking to be told what the framework is as well as the debug bin file even though it doesn’t exist yet because only the code file does.

The thing is that he wants to use vscode for a Unity project. And those ones rely on .net framework rather than .net core, hence you need mono…

For OP’s issue

Setting the environment variable FrameworkPathOverride to the appropriate path for the .net framework version he need, might do the trick.

Yes, instead of setting it globally in /etc/environment, there might be more elegant ways to do this.