Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have an xml file which looks like this


Would it be possible to use a custom importer/writer/reader to create two files, Pistol.xnb and MachineGun.xnb which I can load individually with Content.Load()?

While writing this I realized I could just import a Weapon[] list and split them up with a helper, but I'm still wondering if this is possible?

share|improve this question
up vote 4 down vote accepted

Basically: No.

The content pipeline transforms a single input file into a single output file. It can also do a single input file plus dependencies, into a single output file. And you can also trigger building of other files into assets.

But it cannot generate multiple outputs from a single file.

This thread on the App Hub forums explains it in more detail. (And may have some ideas for work-arounds.)

share|improve this answer
link has decayed – Andrey Sep 4 '12 at 3:37
@Andrey Repaired, thanks :) – Andrew Russell Sep 4 '12 at 4:58

Yes, you can.

With the dependency system, you can call


to make the Content Pipeline build whichever asset you want, and get the external reference to that file. Keep in mind that this isn't very flexible, and all the assets built this way will have the name of the original asset plus "_0", "_1", etc. to mark them as dependent from the original.

Also, ContentProcessorContext is an abstract class and you can inherit from it and extend with the functionality you want. So, when you are compiling your specific asset, create a new instance of your custom processor context and let it do its own magic.

Keep in mind that this requires a very advanced knowledge of the XNA pipeline and will be too much effort if you are a beginner.

share|improve this answer
Even though this technically is a more correct answer, Andrew's was still more the answer I was looking for. – Zeta Two Mar 28 '11 at 16:35
Then if you are expecting a "no", I don't see the point in asking :) – r2d2rigo Mar 28 '11 at 18:05
If you call the second overload of BuildAsset() you will even be able to specify the name of the output asset. – cubrman Mar 29 '15 at 20:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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