Search code examples
xnapublishcontent-pipeline

xna published project without content pipeline?


I'm working on a personal project for learning purposes in XNA. I've read online that using the content pipeline requires people to have the xna runtime installed. So i've decided to load files using Texture2D.FromStream.

Everything is fine when I'm running the project from visual c#, but when I publish the project and run it, it crashed immediatly. I'm not sure if there is a way to see more info on the crash, but I assume not. I'm thinking it's down to not using the content pipeline.

When I look inside the application files for the published project I only see .xnb files. and no raw .png and .xml files that I'm using.

I tried to place the files in there manually but that didn't work aswell. The files are all in the "Projectname\bin\x86\Debug\Content" folder.

Anyone has any idea?


edit

I have just rewritten my contentmanager so it uses the content pipeline, and the published project now works fine on my pc. So I have to figure out a way to get it to work without the content pipeline


Solution

  • if you work with Texture2D.FromStream, you have to care about two facts:

    1. You have to change some resource's properties:

      • Compile action: None
      • Copy to result folder: Always

        This way the xnb won't be builded and you will get your resources instead

    2. You have to set the appropiate path, now you have not "bin\Debug" in your path.