I just installed a new Ubuntu (and I’m still vague on Linux) and installed VS Code and .Net Core and followed instructions for setting up monogame. (before I used Monodevelop on old ubuntu)
I believe I finally have a proper install of everything. I setup a project but it says it can’t find references(assemblies I guess). I searched for how to add references in VS Code and no luck (other than windows versions which seem to be different). I also tried searching for the dll’s manually. I can’t even seem to figure out where monogame exists on the drive. I seen mention of a CLI thing but yet to find out what that is or is for. I’ve also seen Rider mentioned but was hoping to just stick to VS code.
Any ideas, references, or tutorials - or even guesses - at what I could try to get a monogame example to work with VS code on Linux? (I guess my main problem so far is to figure out how to get references to work)
Ok so in the csproj file, I thought this wasn’t enough:
<MonoGameContentReference Include="Content\Content.mgcb" />
<TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="188.8.131.521" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="184.108.40.2061" />
So I thought there must be some other “add reference” thing I’m supposed to do in the IDE (since it kept complaining).
However, I foolishly didn’t try to build the code thinking it wouldn’t work anyway.
Apparently after a first build the issue cleared itself up. ;p
I did find a lot of confusion and ubuntu related issues in initially setting everything up for Linux. Maybe I should do a troubleshooter tutorial for Linux in the future for Linux/VS-code noobs like me. ;p
I wrote one start guide for macos some time ago on my linkedin profile.
It’s in portuguese but I think that would be easy to translate and I think that is very similar to linux.
Ah - thanks very much. This helps clarify my understanding of what needs to be done. Interesting that it’s almost exactly the same method. Ah - muito obrigado. Isso ajuda a esclarecer meu entendimento sobre o que precisa ser feito. Interessante que é quase exatamente o mesmo método.
Now I’m getting VS Code & Linux a lot better. Only issues I had:
- fx wouldn’t build - I guess there’s some way to make it build them with wine or something?
Copied the xnb’s for the “fx” stuff from the windows version. All other content builds were good.
- Language resources didn’t work at first. I just had to change the folder name it was trying to use.
Now it works. I realize now that right clicking on the proj file provides a lot of build and nuget options - and adding some extensions helps too.