Friday 19 February 2010

Cannot load macro project error

After moving 'My Documents' folder to a different drive, I started getting an error when loading the macro's explorer window. The error was:

Cannot load macro project '' for the following reason:

'C:\Users\\Documents\Visual Studio 2008\Projects\VSMacros80\Samples\Samples.vsmacros' is an invalid or inaccessible macro project file

The problem is when you move your documents folder, this updates the environment variable %USERPROFILE%, but the macro's path for Visual Studio are stored in the registry.

Searching the registry I found the following two keys which had a 'path' value, referencing the C:\.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\vsmacros\OtherProjects7\0
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\vsmacros\RecordingProject7


To solve, change the 'path' values in the above keys to your new location and restart Visual Studio.

3 comments:

Anonymous said...

Thanks

Anonymous said...

Thank you Jason!

Heike Triebenbacher said...

In the case, that %USERPROFILE% wasn't changed, check if %TEMP% and/or %TMP% are changed and there's enough disk space there.

I have the situation, that I use a RamDisk for temporary files and after a reboot the size wasn't set correctly. It results in the same error as described above.