1
\$\begingroup\$

I have a Windows Forms application that uses a custom Graphics Device control based on Microsoft's "WinForms Series 1: Graphics Device" sample. The application makes use of a single model (the spaceship model included with the second sample) and its associated texture.

My main project includes a reference to an XNA Game Library project, which contains a Content reference to my Content project. When I build and run the project in either Debug or Release configuration, my model and texture are compiled into XNB format and loaded into the application as expected.

However, when I create an installer (either Windows Installer or ClickOnce) and run it, the content files are not present in any form in the installed location, so obviously I get a runtime exception. I've toggled every option I can find that looks relevant. Am I missing something?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

You need to manually include all of your content into the installer. In Visual Studio, right-click on the setup project, then click View, then File System. Under the "Application Folder", add a folder for Content and all of your XNBs, it should look something like this:

enter image description here

As far as I know, there is no way to do this automatically, even if you include the "primary output" of the Content project.

\$\endgroup\$
1
  • \$\begingroup\$ This does work as a manual fix, but I'm going to hold off on accepting for a while in case somebody knows a way to automate it. Can't even +1 you since I'm a gamedev newbie :( \$\endgroup\$
    – jburbage
    Jan 26, 2012 at 2:32
0
\$\begingroup\$

The installer allows you to add a project's output to a location you specify in the file system editor. Try adding the output from the content project. I believe you should be able to put the output from both projects into the same folder.

\$\endgroup\$
1
  • \$\begingroup\$ The Windows Installer does allow me to configure it in that way. But if I choose "Primary output" I get a compile error ("could not find [path]\Content.dll") and if I choose other options such as "Content" I get no content files installed. Possibly relevant: when I right-click "Content Files from Content (Active)" and choose "Outputs", no files are listed. \$\endgroup\$
    – jburbage
    Jan 26, 2012 at 2:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .