Last thing I did was add a timer in a user control which updates form color. Now every time I open the project, it loads it up and then says 'Visual Studio Stopped Working'.
I noticed that Visual Studio 'runs' the timer while in designer mode too, so I thought that might be causing the problem so I removed the timer from designer.cs and then renamed all the files Visual Studio was opening, but still it crashes. All the other projects work fine. This is the 4th time that it has happened to me. I'm using Visual Studio 2012 Ultimate. Any suggestions please?
On the start window, select Open a project or solution. Visual Studio opens an instance of File Explorer, where you can browse to your solution or project, and then select it to open it. If you've opened the project or solution recently, select it from the Open recent section to quickly open it again. Start coding!
It sounds like your solution settings were corrupted when Studio crashed. You can reset them by deleting your solution's *.suo
file:
*.sln
file*.suo
file in the same folder. Delete it.That will reset all of your solution-specific settings, including the windows you had open.
In the future, you can prevent code from executing in the designer by wrapping it in an if
using the Form.DesignMode
property (inherited from System.ComponentModel.Component
):
if(!this.DesignMode)
{
/* put code to be excluded from the designer here */
}
UPDATE for VS 2017 and 2019
In VS 2017 and 2019, the *.suo
file has been moved into a .vs
folder within the solution directory:
~/[Solution Directory]/.vs/[Solution Name]/.suo
You can just delete the entire .vs
folder to reset your local settings for that solution.
Disabling Visual Studio extensions fixed it for me
Tools -> Extensions and Updates -> Installed
In my case, Web Essentials
was causing the problem
Hope this helps!
If you have a different version of Visual Studio on your computer open that one. Click Debug -> Attach To Process. Select the other Visual Studio process. You should only be able to see one. The Process name is devenv.exe.
Now replicate the problem in the broken VS. It will break on the exception in the unbroken VS.
In my case the exception looked like this
An unhandled exception of type 'System.TypeLoadException' occurred in Microsoft.VisualStudio.Platform.VSEditor.dll
Additional information: Method 'Connect' in type 'JetBrains.UI.SrcView.ContextNotifications.ContextNotificationControl' from assembly 'JetBrains.Platform.UI, Version=104.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325' does not have an implementation.
I fixed it by running the Resharper installer and setting the repair option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With