New errors with the latest MonoGame and Xamarin iOS

I just updated MonoGame and Xamarin to the latest versions, and when I tried to build my project, a few hundred errors popped up. Most of them are in the using statements, e.g. in Game1.cs, the lines below are flagged:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;

Error CS0234: The type or namespace name Xna' does not exist in the namespace Microsoft’. Are you missing an assembly reference? (CS0234)

Can’t figure out why… Can someone please help me with this issue?

you need to right click your project name > add reference > MonoGame.Framework.dll , and whatever other .dll you are missing

Thanks for the reply Shiro! I found out the problem: the MonoGame.Framework.iOS project, MonoGame.Framework.Net.iOS project and Lidgren project referenced by my game project are marked as incompatible (Incompatible target framework: Xamarin.iOS,Version=v1.0).

The problem with adding the dll files is that they are built per platform, so it is not as convenient as including the projects within the solution.

Is there any way to solve this issue?

We have changed to the new Xamarin Unified API. See Automated Updating here:

1 Like

Thanks Nezz! I migrated my project to the Unified API, and now there are errors with the MediaPlayer class, e.g. MediaPlayer.IsRepeating is not working:
Error CS0234: The type or namespace name Volume' does not exist in the namespace MediaPlayer’. Are you missing an assembly reference? (CS0234)

I checked the source file and the IsRepeating property is there. What is causing these errors?

Update: I just realized that MediaPlayer is recognized as a namespace… How can I fix it?

I contacted Xamarin because of this issue. The best thing you can do is put this INSIDE your namespace declaration:

using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer
1 Like