Thursday, January 15, 2009 2:53 PM brian-murphy-booth

The Application Data folder for Visual Studio could not be created.

PROBLEM:

Windows 7 beta is available for download! Of course I immediately download it, format my laptop and install. Next step is to install Visual Studio 2008 so I can work on my various development projects. Unfortunately it kept failing with the following error:

The Application Data folder for Visual Studio could not be created.

TROUBLESHOOTING:

After searching for this error on the Internet and trying the available solutions, none of them fixed the problem. I tried disabling UAC, tried running Visual Studio as an Admin. Tried running in various compatiblity modes. No-go. Next I tried running ProcMon.exe (Process Monitor) from SysInternals thinking perhaps it was a permissions problem or missing folder. There were no obvious "NOT FOUND" or "ACCESS DENIED" messages so that wasn't working out for me. So... I break out WinDBG.exe. Thankfully I have source access to Visual Studio since I support ASP.NET. After the above error pops up, I attach to devenv.exe and switch to the thread displaying the message box. I set the appropriate breakpoint in the source window that automagically pops up, save my workspace, set gflags.exe to launch devenv.exe under the debugger, then relaunched devenv.exe. This time the debugger "breaks in" at the beginning of the method responsible for raising the message box. After stepping through the code I see that we're failing in SHGetFolderPath when passing CSIDL_COMMON_APPDATA to it. Okay super... I try stepping into SHGetFolderPath to see why it is failing but don't have Win7 source code access so I don't get my trusty source window!! But instead, I realize I can run ProcMon again with a filter of "ProcessName = devenv.exe" then right before entering SHGetFolderPath I clear the ProcMon output. I F10 over SHGetFolderPath and doing so only returned about 7 lines of registry reads in ProcMon <whew>. After inspecting the contents of the key(s) using RegEdit that were displayed in ProcMon I see there is some missing data.

RESOLUTION:

In RegEdit.exe, copy the settings from:
  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\FolderDescriptions\{62AB5D82-FDC1-4DC3-A9DD-070D1D495D97}

Into:
  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\explorer\FolderDescriptions\{62AB5D82-FDC1-4DC3-A9DD-070D1D495D97}

Since Visual Studio 2008 is a 32-bit application, it reads all registry settings from the various Wow6432Node keys. Somebody apparently forgot to set that particular 32-bit key. DevEnv.exe now launches for me. :-)

Comments

# re: The Application Data folder for Visual Studio could not be created.

Monday, February 8, 2010 11:22 AM by brian-murphy-booth

Arcy,

You'll only have a Wow6432Node key if Windows is the 64-bit version. Otherwise, the problem you're having is not exactly the same as what I described above. This is what I would do:

1. Download "Process Monitor"

2. Start it and set its filter to only display process name of DevEnv.exe

3. Reproduce the error but don't click "OK" on it yet.

4. Stop the ProcMon.exe logging

5. See what registry keys or folders have "Not Found" as the result.