I'm just about ready to submit my very first game to the marketplace but i ran into this problem.
I realized today that my XAP file seemed reallly small. (350kb roughly) I was reading today that all my content (textures, sounds, fonts) should have their build actions set to "content" rather than "compile" which they were previously set to. I set them all to the "content" setting and now I'm getting "Error loading "filename". File not found."
I didn't change ANYTHING else but the build action and I've confirmed that all the files are not found. Is there something i need to change in my load statements after changing the build action? Currently my load statements look like these.
font = content.Load<SpriteFont>("menufont");
or
ShipTexture = ScreenManager.Game.Content.Load<Texture2D>("Jet");
fyi I've built my game from the ground up using the GameStateManagement sample, in case that matters.
Please help. Thanks.
I'm not sure where you read that, but it's not true.
The ContentManager
object, like Game.Content
, is programmed to look for xnb
files. Those have to be compiled from source files, like .png's, .wav's, etc. Setting to Content
copies the source files over directly into the XAP, and you must thus open it with TitleContainer.OpenStream
to use it, instead of the normal Content.Load
, because it will not be an xnb
file.
If your XAP file is curiously small, it is probably because XAPs use ZIP compression on the entire package. Check out your "Content" folder in your bin\Debug or bin\Release folder to see the full size, uncompressed.