Optimizing code causes textures to display improperly or not at all




I recently attempted to change my project to release and checked this optimize code box inside my build properties. I discovered that this was preventing me from properly debugging my project so I unchecked this box. The result is that for some reason my code does not display textures properly anymore. The background textures are not displaying and the one texture that is displaying (the business.png) is included in my project pipeline build but is not loaded in my load content section. Is there some reason why optimizing my code could have caused the monogame pipeline tool to error is such a way or is this related to the way I am loading my textures?

Are the textures generated in your output folder when you do this?

Another thing to check is if it’s actually drawing the textures or if they’re just not being rendered properly. Compare the values of the GraphicsMetrics (GraphicsDevice.Metrics) after you finish drawing everything in both the optimized and unoptimized code.

The issue was actually just related to my build not updating. I deleted my obj and bin folders and uninstalled the build on my emulator. After rebuilding my current texture layout was correct. Thanks!