Doubt between System.Numerics.Vector2 and Microsoft.XNA.Framework.Vector2

I am beggining in Monogame and I have this class where I use Vector2 but I am getting the following warning


What should I choose?

XNA is the framework from microsoft (Monogame) so if you see a conflict between anything xna it will usually be the corect if you use xna

It means you are referencing two assemblies that have the same classes in them.

  1. If you can remove any duplicate/invalid references.

  2. Avoid using USING and fully qualify everything

In your case you have a “using System.Numerics” which has a Vector2 class as well as probably this one “using Microsoft.Xna.Framework” which also has a Vector2.

While they may be compatible, it’s never a good idea to let the compiler pick which one to use.

Remove the “using System.Numerics” and fully qualify anything that references that and that error will go away.

1 Like

Just making this clearer…

Edit

Qualified amended