I'm creating an app in XNA.
I'm trying to load a custom save file. I named the file with my own custom extension. It's an XML file serialized with the DataContractSerializer.
I've tried several things to load the file. And they all work when I'm running in my development environment, or when the game is running from most folders, but if the game has been placed in the program files folder (or any other protected by Windows 7), the game won't load my custom files, but it will load images and other items that the content importer handles naturally.
Things I have tried:
- Directly loading the file using the DirectoryInfo.CurrentDirectory() then scanning for files, and loading them.
- Using the StorageContainer.TitleLocation
- Creating a custom importer, and loading them into the content pipeline
In all cases, it works fine running in my IDE (C# Express 2008), but when the app is running from Program Files, I get the following error:
Access to the path 'C:\Program Files\MyFolder\MyAppName\Content\CustomFolder\Blah.CustomExtension' is denied.
I am running as administrator (though obviously, I eventually don't want the end user to need this right).