subject: How to Fix "The application cannot start" Error [print this page] How to Fix "The application cannot start" Error
What is "the application cannot start"error
So, you're sitting on your couch and all of suddenepiphany! You've got the solution to the code problem you've been working on for a few days! You go to fire up Visual Studio, and instead of being treated with a new instance of VS you are presented with this -- the dreaded error: "The application cannot start.":
"Well, it was working fine this morning!" you say. "What happened!?"
The reason on why"the application cannot start"error happen
I wish I had a quick, easy, one-line answer for why this happens, but as with most things in life, it isn't that simple. There are a number of scenarios that will cause the IDE to get into this state, which makes diagnosing this issue rather non-trivial.
When Visual Studio is launched, the initialization code branches off and begins to perform a number of tasks such as reading the window layout, importing the saved settings, loading a number of .dlls, creating the main window, etc. If any one of these operations encounters a critical exception from which it cannot recover (which means VS won't be able to initialize properly), an error is raised and the user is presented with "The application cannot start."
Now, you may be asking, "Well the least you could do is give me some exception message that would make debugging this easier, right?" Unfortunately, no. Because of the managed to native interop on the initialization thread, all the code gets back is an HRESULT; it loses its error context. There are a few alternative approaches that we are investigating for RTM around providing a more meaningful error message.
How to fix such error?
Now that I've given you the background, what do you do if you hit this? We'll start with the most common case, at least for Visual Studio 2010 Beta 2.
The Issue
In Visual Studio 2010 Beta 2, there are two straightforward ways to get into this state. Both of these issues have been fixed for RTM, and, fortunately, there are workarounds for Beta 2.
The first issue is importing a non-TrueType font from a previous version of Visual Studio. This was already covered by Brittany in her excellent blog post.
The second way to get in this state is by a corrupted window profile the file that persists your IDE window state. If you have floating tool windows (e.g., drag off Solution Explorer to another monitor or show the Find dialog), minimize Visual Studio, and then close Visual Studio from the minimized state, on the next launch you will hit this error.
The Workaround
To workaround these issues, you'll need to reset your settings file. NOTE: The IDE will be reset to its default state and all customizations will be lost. If you have customizations that you want to save, please copy CurrentSettings.vssettings under "%USERPROFILE%DocumentsVisual Studio 2010Settings" to another location.
If you're using a non-Express SKU:
Start Menu->Run (or Windows Key + R for the keyboard savvy)
Type "devenv /resetuserdata". The issue should now be fixed.
If you wish to reimport your old settings, go to Tools->Import and Export Settings, select "Import selected environment settings and browse to the .vssettings file you saved.
If you're using an Express SKU your steps will be a bit different:
Start Menu->Run (or Windows Key + R for the keyboard savvy)
Depending on the SKU installed, type the following: For Visual Basic Express type, "vbexpress /resetuserdata"
For Visual C# Express type, "vcsexpress /resetuserdata"
For Visual C++ Express type, "vcexpress /resetuserdata"
For Visual Wed Developer Express type, "vwdexpress /resetuserdata"
What we've done for RTM
As mentioned above, both these issues have been fixed for RTM. Additionally, we've also added better fallback scenarios so that if something does go wrong, the IDE will try a few workarounds itself.
What if that didn't fix the problem?
The above workaround should fix the majority of users that run into this issue, but if you've tried that to no avail, here are a few other things you can try:
Browse this MSDN article. This article is a bit outdated but does have some other causes and workarounds for fixing this issue.
Some users have had success using procmon to see what Visual Studio is trying to load. This isn't for the faint-hearted, but it might help you debug the issue.
Analyze the Activity Log. Sara Ford has a post on how to do this.
If your still experiencing problems, the best option is to file a Connect Bug so that we can take a further look. To help us debug, please attach the following files to the bug:
Your window layout file: the file will be named "Design_somecharacters.winprf" under "%APPDATA%MicrosoftVisualStudio10.0"
Your settings file: "CurrentSettings.vssettings" under "%USERPROFILE%DocumentsVisual Studio 2010Settings"
Your Activity log: From a Visual Studio Command Prompt, type "devenv /log". Attach "%APPDATA%MicrosoftVisualStudio10.0ActivityLog.xml" to the bug.