Search code examples
c#monogame

Monogame: Assets not being loaded after changing the properties


I am using VS2015 and monogame

Before anything, I have searched for my question, and I have followed the steps those answers told me to. I have changed the .xnb files' build action to "Content" and Copy to Output directory to "Copy if newer".

Unfortunately I am still getting the error that "Could not load Content\Graphics\burger asset as a non-content file!" While highlighting the following line:

  sprite = contentManager.Load<Texture2D>(spriteName);

Could not load Content\Graphics\burger asset as a non-content file! is what I get when I check the details


Solution

  • I have found the answer. Apparently, or at least for this particular code which I had received, what worked was adding the content directly on the monogame content pipeline (present in your slm file) and building that, instead of adding the converted .xnb files externally after building them on monogame serperately. I wish I knew why this happened, because previously loading xnb files externally worked perfectly, but this is how I got my desired output. Thank you for the help though!