Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
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 :( –  jburbage Jan 26 '12 at 2:32

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.

share|improve this answer
    
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. –  jburbage Jan 26 '12 at 2:12

Your Answer

 
discard

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.