I've been experiencing a really Strange problem since recently, Every variablesofvariables of XNA Framework Game class seems not to be initialized before my extending Game1 () class. The Content manager and the Window that shouldVariables does not be null, but like after I've triedseem to add a dll pipeline (that makes my content pipeline crash bybe initialized before the way) everything started to go wrong like this problem. I've had this after trying to import a.fnt (did not work) and a localized Spritefontpoint where they should be.
I do not plan to change the game engine, but I'll appreciate any help of any kind.
Thanks for your time
here is my Game1 class (a small part of it)
public class Game1 : Game
{
public static GraphicsDeviceManager graphics;
public static SpriteBatch spriteBatch;
public static ContentManager ContentManager;
public static SceneManager SceneManager { get; private set; }
public Game1()
{
ContentManager = Content;
graphics = new GraphicsDeviceManager(this);
ContentManager.RootDirectory = "Content";
// TODO: Add your initialization logic here
/*
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width
*/
Window.IsBorderless = true;
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
IsMouseVisible = true;
}
(...) //The code continues
}
and here is the errors:
the Null pointer error on the Window variable occures when i declare a new Content manager
Edit:
It seem that there is a conflict between System.RunTime.Serialization v4 and v2 in my project
1> Impossible de résoudre le conflit entre "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" et "System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". Choix arbitraire de "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".