I've been experiencing a really Strange problem since recently, Every variables of XNA Framework Game class seems not to be initialized before my extending Game1 class. Variables does not seem to be initialized before the point 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".