Error when adding a database to Visual Studio 2008 Project
I was working on an c#project and needed to add a lightweight deployable database to store some configuration information for the program. My first thought was to use the SQL CE 3.5 database that I had used previously on Windows Mobile application development.
When I attempted to add the .SDF database file to the project i got the following:

"An error occurred while processing the local data file: The system cannot find the file specified."
So I tried to use a local data file .MDF instead with the same results. I tried to add it through the Server Explorer and got even more unusual results. I tried to reinstall the Compact Edition v3.5 and even reinstalled Visual Studio 2008 again but it didn't help.
Eventually I discovered that this issue was due to a recent registry corruption. The HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData key was missing from my system. If you encounter this issue, check in your registry for that value, if it is not present add it as an Expandible String Value in the HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders folder. The string value should point to your user application data directory. This is typically something like "%userprofile%\Application Data"
Once this was added, a restart of Visual Studio wasn't even required it worked immediately. Definitely not a helpful error message.
