Content Loader Can't find files in Content Hierarchy

:frowning_face:
xnamgcb

FileNotFoundException: Could not find file ‘E:…\bin\Debug\netcoreapp3.1\Content\heightmap1024.xnb’

Why not look in the folder in the Content hierarchy then?
What must I do in order to point the loader to a folder in the project’s Content?

Try:
var myImage = content.Load(“Images/heightmap1024”);

Also make sure you have built the xnb file from the png by running build in the Content Editor.
(You can check to see if the xnb file exists in the path it is complaining about).

:facepunch:(punching myself) Well that makes sense. Works too.

Also make sure you have built the xnb file from the png by running build in the Content Editor.
(You can check to see if the xnb file exists in the path it is complaining about).

Thanks for the reminder. I always do.
I had switched to using FileStream when I realized that my 458 kb png had transformed to over a 5 MB xnb. :open_mouth:
Then I tried compression, and it shrunk it to double the size of my png, then I said, Okay. I can settle for that". :slight_smile:

Thanks for answering.

1 Like