I'm getting a strange exception when trying to load in a .tmx file using MonoGame.Extended. I can load the same .tmx file into other 3rd party libraries (tried to recreate the error) without any problem which makes me suspect it's not something to do with the file.

tiledMap = Content.Load<TiledMap>("Test");  //line of code for exception


Microsoft.Xna.Framework.Content.ContentLoadException Could not load Test as a non-content file!


This error is most likely happening because the content hasn't been built correctly with the MonoGame Pipeline tool. All content in MonoGame must be built into an XNB file before in can be loaded into the game.

The first thing to check is to make sure you've added a reference to the MonoGame.Extended.Content.Pipeline.dll in your Content.mgcb file.

Open the Content.mgcb file in a text editor and look for lines like this:

#-------------------------------- References --------------------------------#


If it's not there you'll need to add it. Unfortunately, this reference is not automatically added when the NuGet package is installed so you'll need to do it manually.

Copy the above /reference line and add it to your Content.mgcb file. Make sure the path is correct, in particular the version number. You should be able to locate the DLL in your packages folder. There's also an install guide blog post that goes through this in more detail.

If everything is correct you should see the Tiled Map Importer and Processor show up in the Pipeline GUI.

enter image description here

  • \$\begingroup\$ Thanks so much for the response. I've done all of the above, but now the MonoGame pipeline is telling me I'm missing the 'Ionic.Zip' assembly when it attempts to convert the .tmx file. \$\endgroup\$ – MrVariable Dec 11 '15 at 13:17
  • \$\begingroup\$ Can you see the 'Ionic.Zip' file in the same directory as the MonoGame.Extended Content Pipeline dll? \$\endgroup\$ – craftworkgames Dec 11 '15 at 14:16
  • \$\begingroup\$ Ah, thanks for pointing me in the right direction. I noticed it was missing, so I reinstalled MonoGame.Extended. Everything's working perfectly now. \$\endgroup\$ – MrVariable Dec 11 '15 at 16:05
  • \$\begingroup\$ As an aside, I just noticed that you're the guy behind the library itself. I was thinking over the Christmas holiday of trying to create some Unity style docs to make things easier for other programmers new to MonoGame.Extended. I would really like to see this library get more of a foot hold than it already has. \$\endgroup\$ – MrVariable Dec 11 '15 at 16:08
  • \$\begingroup\$ Thanks. I'm glad you got it working. Yes I am the guy behind the library. Trying to do my bit to help fellow game developers. Any help with the project is always appreciated. We don't really have a proper forum yet, so raise an issue on github and we'll discuss it there. \$\endgroup\$ – craftworkgames Dec 11 '15 at 20:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.