# Error on MonoGame Content Pipeline: Texture Importer Error

I just encountered this kind of error when using the MonoGame Content Pipeline and it's my first time to use it to convert png to xnb files (I use a stand alone app for converting files to xnb in the past). I've done building spritefonts to xnb files and stuff like that in my previous MonoGame projects and I thought it would be similar but it turned out to be not the case.

So this is the error I have:

error: Importer 'TextureImporter' had unexpected failure!
System.NullReferenceException: Object reference not set to an instance of an object
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter1[Microsoft.Xna.Framework.Content.Pipeline.Graphics.TextureContent].Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import (System.String filename, Microsoft.Xna.Framework.Content.Pipeline.ContentImporterContext context) [0x00000] in <filename unknown>:0
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00000] in <filename unknown>:0
`

Is there a way to resolve this? Is there a tutorial of some kind I can follow to use the TextureImporter and the things I haven't yet understood on MonoGame's Content Pipeline with in-depth explanation about it?

• Show us the relevant code that causes the error – dimitris93 Sep 7 '15 at 21:04
• Do you have the latest version of the monogame content tool? I believe there was a bug related to this. (See github.com/mono/MonoGame/issues/4000 ) – Felsir Sep 7 '15 at 21:26
• @Shiro There is no code involved as I am just trying to convert png files to xnb files using the MGCB. – arvicxyz Sep 7 '15 at 23:44
• @Felsir I think I have similar MGCB version which is 3.5.0.344 that fails. I see... I'll look into this. Thanks man. – arvicxyz Sep 7 '15 at 23:48

You need to download and install the Visual C++ Redistributable Packages for Visual Studio 2013.

These two posts on https://github.com/mono/MonoGame/issues/3556 worked for me:

tomspilman:

Hum... the redist we need vcredist_x64.exe is only 7MB. If you download and run it from the command line:

vcredist_x64.exe -?

It tells you that it has /quiet and /norestart mode:

We should be able to embed this into the Windows installer fairly easily if we want.