0

I have finished making a game; however, when I try to publish it. It publishes fine but when launching the application it crashes SpriteFontenter image description here

It says that it could not find MyFont.xnb (which is a SpriteFont in the content folder)

When I go to my Program Files and look, the SpriteFont is nowhere in my solution. Why did it not build with the rest of the program?

In my application itself, I made sure to include the asset and it works fine if I run the program on my machine. It only crashes like this after I publish the application.

Proof

How do I fix this issue?

Technocrat
  • 334
  • 1
  • 4
  • 15

2 Answers2

1

Try checking the properties for the file in whatever compiler you're using.

In visual studio for example :

Make sure Build Action is set to compile.

Make sure copy to output directory is set to anything but do not copy, which is the default for monogame in my experience.

  • I did this, and even did this post: http://stackoverflow.com/questions/7313764/xna-published-project-without-content-pipeline but none of them work. It says "could not load MyFont.xnb as a non-content file - inner exception -> file was not found" I open up my Content folder in my Installation folder and the file is not there. That is my only problem. – Technocrat Sep 07 '14 at 06:51
0

Okay so I fixed my issue:

I made my XNB file Build Action set to: "Content" and "Copy always"

Then, when setting up the project to release I used InstallShield Limited Edition Deploy.

When asking me for which files to deploy, I made sure to select "Primary Output" "Content" and "Add File" -> "MyFont.xnb" and I added it in manually, that made sure it was ready to go.

Technocrat
  • 334
  • 1
  • 4
  • 15