Content Path "DirectoryNotFoundException" ( build only, fine in dev)

I’m running into an issue where (only on builds, both Mac and Win) the spritesheet content loader (just a basic FileStream) is attempting to load from the user directory rather than from the Content folder as expected.

You can see below I’m logging out the path from which I’m attempting to open the FileStream followed immediately by the error. It looks like rather than looking at the Content folder directly adjacent to the executable it is looking in my root users directory.

Content/tpSpriteSheet.png
Unhandled exception. System.IO.DirectoryNotFoundException: 
Could not find a part of the path 
'/Users/{MY_USER}/Content/tpSpriteSheet.png'.

I’m sure I’m just goofing something up. This is my first monogame project, learning the framework by building a simple space invaders clone.

Any thoughts?

Thank you.

1 Like

Looks straight up like a rights access issue, why is the game in that folder?

Why is the content in that folder?

I think you need to use relative paths…

1 Like

Thank you… yep… I agree. Looks like an access issue.

The weird thing. It isn’t in that folder. It’s on my desktop in an app bundle.

The Content/tpSpriteSheet.png just before the unhandled exception error is the relative path it should be looking in.

Similar issue happens on PC and Mac.

I’ll fiddle with the paths though, maybe something will shake out.

Have you tried the downloads folder?

I am having the same issue, did you ever resolve it?