Click here to Skip to main content
14,669,324 members
Rate this:
Please Sign up or sign in to 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
ZurdoDev 20-May-16 15:53pm
   
I'm hoping the OP responds to let me know if it worked for them or not. Thanks.
Sergey Alexandrovich Kryukov 20-May-16 16:37pm
   
Sure.
—SA
Member 10854933 20-May-16 16:11pm
   
what do you define as potentially dangerous functionality? The page functions just fine when compiled and debugged. Its opening the form in design mode that is causing the problem
Sergey Alexandrovich Kryukov 20-May-16 16:38pm
   
Anything which can throw an exception. It's easy to handle during application runtime, but makes a blocked when happens under the designer. Generally, the designer runtime should be minimized as much as possible. Only the features related directly to the design process should remain.
—SA
Member 10854933 20-May-16 16:06pm
   
this made it worse. Now when I open the project that was left in design mode it immediately crashes.
ZurdoDev 20-May-16 16:07pm
   
You broken then.
Member 10854933 20-May-16 16:10pm
   
I deleted the suo file for the project and I can atleast open the project.This and several other problems I have been having with visual studio means I will have to uninstall it and reinstall it.
ZurdoDev 20-May-16 16:15pm
   
Sounds like a reinstall might be the fix.

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100