Well this is a list of problems i have encountered and how i solved them. Maybe all of this is obvious but it might help someone staring out. If nothing else i documented this for me.
Feel free to criticise, banter or mock my solutions
Visual Studio 2019 likes to report nuget warnings. Yellow triangles on the monogame packages. At best everything works fine and at worst your autocomplete stops working or you cant build your project.
It gets alot worse with shared projects or if you have a lot of references.
Restart your solution or drop and reload the project.
Some of the templates don’t have any Conditional compilation symbol. So if you do some #if in your project it will fail to use them.
In the preferences of your project in the Build tab you can add them.
For example the OpenGL use to have LINUX in 3.7 you can add more separated by ;
Like so IOS;MOBILE
You can’t build because you are missing external dependencies.
Open project file and add CopyLocalLockFileAssemblies = true:
<PropertyGroup> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> </PropertyGroup>
Referens libraries to an Android project gives error:
The type or namespace name ‘AndroidGameActivity’ could not be found (are you missing a using directive or an assembly reference?)
In the library project make sure your Monogame PackageReference is correct:
This is wrong and will not work trying to reference file in Android project:
<ItemGroup> <PackageReference Include="MonoGame.Framework.DesktopGL" Version="18.104.22.1681" /></ItemGroup>
This is the Correct way and will work:
<ItemGroup> <PackageReference Include="MonoGame.Framework.DesktopGL" Version="22.214.171.1241"> <PrivateAssets>All</PrivateAssets> </PackageReference> </ItemGroup>
Content folder not found error when using a Shared project on Android if you delete the content folder in the project.
The references in the Android project file are still there. you have to manually delete it. Open the project file and delete the following lines:
<ItemGroup> <MonoGameContentReference Include="Content\Content.mgcb" Visible="false" /> </ItemGroup>
Using FreeImage in a pipeline to manipulate image files on build fails.
Well none… but i rebuilt it in ImageSharp and that works. More info here Pipeline extension 3.8 Unable to load DLL 'FreeImage'
You cannot reference .netcore 3.1 projects in to Android project.
Make sure you make all projects .netstandard 2.0 that needs to be referenced in multiple platforms.