Getting a exception when trying to load my Tiled map

I’m new to monogame.extended and coding in general so sorry if this is a obvious mistake but here is the exception i get when loading the map


here is the rest of my code

and i’m assuming the drawing code wont be needed

This particular exception is probably because NewMap is invalid or doesn’t exist.

There are a whole bunch of reasons why this might happen.

  • The first thing I would suggest is checking to see if the TMX file is building with the Content Pipeline tool
  • Make sure you’ve got the name correct including the casing (e.g. “newmap” is not the same as “NewMap”)
  • Try loading a different map file, maybe one out of the demos.
  • Make sure you’ve also got all of the maps dependencies in the Content Pipeline (e.g. textures, etc).

If you’re still having trouble I suggest raising an issue on github and explain what you’ve tried and attach a copy of the map that you’re trying to load (or another one that has the problem).

so it does build it correctly and i tried using one of the demos and it loaded it without any errors but i cant figure out why it wont load my map. got any other ideas or should i raise a issue on github?

With these generic kind of NullReferenceException's it’s really hard to tell what the problem is.

So yeah, you’ll need to provide more information, preferably as a github issue.