Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a web form I am developing in VS 2013. When the Design mode is selected, Visual Studio crashes

What I have tried:

I tried opening Visual Studio 2013 in /safemode and /log
When I searched the activitylog.xml for errors, the word ERROR was not found.
Posted
Comments
Richard MacCutchan 20-May-16 11:25am    
Try opening the .Designer.cs file in an editor to see if you can find out what is wrong with it.
Andy Lanng 20-May-16 12:22pm    
Another trick is to open a second VS2013, attached it as a debugger to the first vs2013 ('devenv' in processes) and see if that gives you an error message.
Member 10854933 20-May-16 12:51pm    
I received this error

System.Runtime.InteropServices.InvalidComObjectException was unhandled
Message: An unhandled exception of type 'System.Runtime.InteropServices.InvalidComObjectException' occurred in mscorlib.dll
Additional information: COM object that has been separated from its underlying RCW cannot be used.
ZurdoDev 20-May-16 14:50pm    
Try adding

protected override void OnInit(EventArgs e)
{
if (DesignMode)
return;
base.OnInit(e);
}
Sergey Alexandrovich Kryukov 20-May-16 15:49pm    
This is the best advice so far. In fact, the best approach is to put all potentially dangerous functionality under if (!DesignMode) { }
and leave to the designer only the basic rendering needed for making the layout.

It would make a fair formal answer.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900