MonoGame / MonoGame

One framework for creating powerful cross-platform games.
http://www.monogame.net
Other
11.3k stars 2.9k forks source link

NullReferenceException on game.Run(); #1084

Closed SonicTTH closed 9 years ago

SonicTTH commented 11 years ago

Hello,

I'm just trying out to convert my current xna project to the monogame framework, and it worked out very well so far, I get to compile without any errors (I followed this tutorial: http://crankgaming.blogspot.de/2012/02/xna-to-monogame.html). I needed to change some names because the names of enumerators differ a little, but thats not a problem. When I run now, I get a nullreference exception in my Program.cs file's Main() function. It looks like this:

    static void Main(string[] args)
    {
        Nuker game = new Nuker();
        game.Run();
    }

The exception occurs on game.Run();. I set a breakpoint at Nuker game = new Nuker();. and I saw that it was hit twice before the exception occurs, so somehow this main function is executed repeadedly?

I hope someone can help :)

I'm really much interested in this and it would be great to have this running independendly :)

danzel commented 10 years ago

Have you tried this again lately? Sounds like you got somewhere as you've since posted #1901 Can we close this?

Chaosus commented 9 years ago

@tomspilman Outdated, obsolete,uninformative issue. the user should use standart notation(and probably dont touch Program.cs)

using (var game = new Game1()) game.Run();

and there will not problems like this.