The state of content building methods

Hi, there seem to be a few different ways of building content. I’ve had varying levels of success with them. I’d like to start a conversation about the different methods, which is/are ideal, and what the limitations and bugs are.

In my case, I am porting from XNA at this moment. My code built just fine, but I’m having difficulties with content. I have a custom model processor, so I reference my own content processor DLL in addition to any XNA and Monogame DLLs.

The methods I’m aware of for building are:

  1. Create a Monogame content project in Visual Studio and build it from there.

This presumably works, but I am trying to get away from this static approach that is dependent on Visual Studio.

  1. Create an in-memory content project at run-time using the MSBuild namespace in C#. This is the idea used in the XNAContentCompiler project (https://xnacontentcompiler.codeplex.com/releases/view/60222).

This worked fine for me in XNA, but I’m having trouble loading DLLs for Monogame, presumably because of 32/64-bit issues.

  1. Create a .build file for use with msbuild.exe.

This is mostly working for me (although with the downside that I can’t catch exceptions from it for more detailed error reporting, which I could do with approach #2).

The big issue I’m facing at the moment is that it doesn’t seem to work for content files that aren’t in the same directory or a child directory compared to the directory where the build file and/or msbuild are located. What I’m doing is creating a temporary directory, copying msbuild.exe, all the necessary dlls, and the build file to that temporary directory. The content files are not copied to the temporary directory. Instead, they are referenced by their full path. I’ve tried both absolute paths and relative paths (that contain a ton of “…/…/…/…/”). I get an error that says:

G:\Temp\DefaultExplosion.png : error : Invalid asset name “G:\Temp\DefaultExplo
sion”. [G:\Users\Dan\AppData\Local\Temp\XNAContentCompiler.ContentBuilder\5684
1\monogamecontent.build]

Now, the thing is that this works fine if the content file is in the same directory as msbuild.exe and the .build file. It simply doesn’t seem to be able to handle “outside” paths. Why would I want to do this? Mainly for fbx files. The files can reference images, and I don’t really have a way to track those dependencies myself, so I can’t copy all the necessary files to the temp directory.

This basically sums up my knowledge on the subject. I’d like to know if anyone else can add to the knowledge pool, especially if it involves solutions to any of the issues I’ve raised.

Sorry… I didn’t see this post till just today.

So at this point the recommended method is to use the new Pipeline tool and/or MGCB directly.

We know there are probably places where it is missing some functionality or has a bug. We ask people to report these and we’ll try to fix them as soon as they come in.

In the cases where the new pipeline doesn’t work, you can usually fall back on XNA’s implementation. But we are really working hard to make that not necessary anymore.