Hi I am having the following issue
‘Content reader could not be found for Microsoft.Xna.Framework.Vector2 type.’
Code that fails
Sprite.SpriteData = ScreenManager.Instance.Content.Load(“data/screens/splashscreen”);
Stack Trace
at Microsoft.Xna.Framework.Content.ReflectiveReader`1.GetElementReader(ContentTypeReaderManager manager, MemberInfo member)
at Microsoft.Xna.Framework.Content.ReflectiveReader`1.Initialize(ContentTypeReaderManager manager)
at Microsoft.Xna.Framework.Content.ContentTypeReaderManager.LoadAssetReaders(ContentReader reader)
at Microsoft.Xna.Framework.Content.ContentReader.InitializeTypeReaders()
at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T]()
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
at SpaceGame.GameScreen.LoadContent() in C:\Users\davem\source\repos\SpaceGame\SpaceGame\BaseClasses\GameScreen.cs:line 25
at SpaceGame.ScreenManager.LoadContent(ContentManager Content) in C:\Users\davem\source\repos\SpaceGame\SpaceGame\BaseClasses\ScreenManager.cs:line 42
at SpaceGame.SpaceGame.LoadContent() in C:\Users\davem\source\repos\SpaceGame\SpaceGame\Game1.cs:line 35
at SpaceGame.SpaceGame.Initialize() in C:\Users\davem\source\repos\SpaceGame\SpaceGame\Game1.cs:line 27
at Microsoft.Xna.Framework.Game.DoInitialize()
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
at SpaceGame.Program.Main() in C:\Users\davem\source\repos\SpaceGame\SpaceGame\Program.cs:line 11
I created a separate data project where my SpriteData class sits
Sprite Data Class
SplashScreen.xml (obviously built as an XMB at runtime)
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:ns="Microsoft.Xna.Framework">
<Asset Type="SpaceGame.Data.SpriteData">
<Path>images/universe</Path>
<Alpha>1</Alpha>
<Text></Text>
</Asset>
</XnaContent>
No Build errors just the run time error and if I remove the Vector2 fields it runs just fine, i have made all fields optional as you can see and am not even referencing a Vector2 field in the XML yet. I have added a reference to SpaceGame.Data debug dll in the the main SpaceGame MGCB which is obviously working because as i said it builds just fine if there are no Vector2 fields in the SpriteData class.
I am completely new to Monogame so this could be an obvious rookie mistake but i cannot find anything online that has helped me here so any help would be appeciated!