Using Visual Studio 2008 I first encountered this when trying to open a standard save file dialog box in visual basic. So far I've worked around it after fruitless searching. Now I find that any action which would cause a save/open dialog (eg. ctrl-O) also fails. I've searched more and still don't know how to fix it.
Stuff I do know: It's not a Visual Studio error, it apparently can occur in any number of other applications (which is why searching for it is annoying)
It's either .NET or COM related, I tried reinstalling all of .NET with no luck, and I've never mucked around with COM ever, I don't really even know what it is.
Something is missing, misplaced, or it could be DLL version issues.
I really don't want to deal with uninstalling VS2008, or MS Office (as one result I found suggested) or any other big application.
So, somebody, somewhere is trying to CoCreate some object that it (thinks) it needs to do its job. This may or may not be a Visual Studio object. Since it manifests in the Save / Open dialog it could very well be a shell object.
The most likely explanation is the registry entry for the object has been corrupted in some way, or the dll that exports the object is corrupted in some way. For the latter it could be missing completely, or just in a bad state for some reason.
One thing you can try doing is running regsvr32 on likely candidate DLLs, but that's just shooting in the dark.
Another, more advanced option is to attach a debugger (such as ntsd or windbg) to the Visual Studio process it self and set a breakpoint on CoCreateInstance() in the system dll (make sure to look up its exact signature in the header file—it may be #defined to something else). Then get the GUID for the object that it is passing as the argument to CoCreateInstance(). Looking this up in your registry (or a friends registry that doesn't have this issue) should give you a good idea of what DLL you need to go mess with.
The underlying problem here is that a CoCreateInstance is failing. Without attaching a debugger and breaking in CoCreateInstance it's going to be fairly difficult to track down what the problem is. And even if you spend the time to do this, it's unlikely that you'll be able to fix the error.
I agree that a re-install is a last resort. But an in-between step is to attempt to repair the install. If you re-insert the VS Setup Disk, one of the options will be to "Repair" the installation. You may have to go through Add/Remove Programs to get this option.
A Repair is much faster than uninstall/reinstall and will very likely fix this particular issue.
EDIT
OP reported repair succeeded but did not fix the error. Can you check the event log and see if a more specific error is being generated for this failure?
I've faced similar issue with VS 2008 and luckily it got solved with the below solution. Try this!!
Locate devenv.exe. Right click >Properties > Uncheck Disable Visual Themes Option
Unchecking Disable Visual Themes
didn't work for me, but running in xp compatibility mode fixed it. I'm assuming the problem is a missing dll.
User contributions licensed under CC BY-SA 3.0