Click here to Skip to main content
11,920,211 members (45,051 online)
Click here to Skip to main content
Add your own
alternative version


24 bookmarked

How to solve "The format of the file 'devenv.exe' is invalid" blank white page exception at design time

, 26 May 2003 CPOL
Rate this:
Please Sign up or sign in to vote.
Shows how to find the exception that kills the designer
<!-- Article image -->

<!-- <!-- Article image -->


Often if you work with inheritance with System.Windows.Forms or use third party stuff (preferred where you do not have the source) and hit Shift+F7 (View Designer), a blank white page is the only thing the designer is able to show. Normally you're confused, don't know where to start searching for this unexpected feature of VS.NET Designer. Maybe it could be the last lines of code you added today, or it could be code that nobody remembers, 'cause it was written last month from a external worker. What to do know? You should check in your code running in a few hours ?


It's my job to write the UI front end library for the company i work today. There are 5 team members, which have to use my code. Every time the designer shows a white blank page, my name is called and i have to (try) fix it as fast as possible, not nice if you don't where to search the bug.

Solution Configuration

Visual Studio supports different Solution Configurations (sc), debug and release are the default ones. 'Cause we're able to add/delete this sc, we're able to add a new sc which supports design time debugging. If you're able to debug the design time, you're able to find the exception that killed the designer, you remember, blank white page.

  • Right click your solution and choose the Configuration Manager... context menu item.
  • In the "Configuration Manager" choose <New>.
  • Specify a name for your new solution configuration.
  • Hit Ok twice, the created sc is now selected.
  • Right click your project and choose "Properties" context menu item
  • The well known project property pages are now open, select Configuration Properties\Debugging
  • Switch Debug Mode to Program.
  • Let Start Application point to your devenv.exe file. See also

screenshots are available here (animated gif which opens in new window).


Now hit Ctrl + Alt + E, or choose Exceptions under main menu Debug\Exceptions. Because we don't know exactly which exception type we're trying to find, we best choose Break into debugger for the Common Language Runtime Exceptions. After playing around with the white blank page problem I know that System.BadImageFormatException is thrown.

Bust it

The good news is that you're now ready to bust those tricky exceptions which kicks our designer. The bad news is that the designer does not work proper cause there are exceptions in our code. We did something, that is not valid in design time, but will executed there. Or there is another exception of certain kind, also not valid for design time.

  • Hit F5 to start debugging, as you expected Visual Studio starts another Visual Studio instance where you will
  • Open the same solution you just prepared for design time debugging.
  • View the form in design mode that normally cause the designer to fall.
  • Behind your current Visual Studio should appear the well known exception dialog, hit Break and you see the code thrown it.
  • Repeat this steps until you're code is exception free (illusion), but sure till the designer work proper.


The demo application gives you a good sample, if you try to load form2 in designer, he crashes. Please make sure that the path to the devenv.exe reflects your current installation, otherwise the debug mode will not work proper.


  • I hope with this knowledge you could solve your design time problems, for my own it does.


  • 27.05.2003 final release

Have fun with it...


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


About the Author

Chris Richner
Software Developer (Senior) Zeit AG
Switzerland Switzerland
My interest is in the future because I am going to spend the rest of my life there. (Charles Kettering)

  • 1996 - 1998 PC Board PPL, HTML, DHTML, Javascript and ASP
  • 1999 - 2001 coding Centura against Sql Database (SqlBase,MSSQL,Oracle)
  • 2002 - 2004 C# Windows Forms
  • 2005 - 2006 C# ASP.NET, Windows Forms
  • 2006 - 2009 C#, WCF, WF, WPF
  • 2010 - 2012 C#, Dynamics CRM, Sharepoint, Silverlight
  • 2013 - 2013 C#, WCF DS (OData), WF, WPF
  • 2014 - now C#, Azure PaaS, Identity, OWIN, OData, Web Api
  • family & friends
  • chilaxing ,)
  • coding

You may also be interested in...

Comments and Discussions

GeneralNice tip, slight typo Pin
Richard Deeming30-May-03 8:02
memberRichard Deeming30-May-03 8:02 
GeneralRe: Nice tip, slight typo Pin
Jerry Maguire30-May-03 8:52
memberJerry Maguire30-May-03 8:52 
GeneralThanks!! Pin
rahtrow29-May-03 3:44
memberrahtrow29-May-03 3:44 
GeneralRe: Thanks!! Pin
Jerry Maguire29-May-03 9:24
memberJerry Maguire29-May-03 9:24 
GeneralAnother way route to debugging devenv Pin
Lee Alexander29-May-03 0:03
memberLee Alexander29-May-03 0:03 
GeneralRe: Another way route to debugging devenv Pin
Jerry Maguire29-May-03 9:26
memberJerry Maguire29-May-03 9:26 
GeneralRe: Another way route to debugging devenv Pin
Lee Alexander29-May-03 23:18
memberLee Alexander29-May-03 23:18 
GeneralRe: Another way route to debugging devenv Pin
PhallGuy3-Jun-03 11:52
memberPhallGuy3-Jun-03 11:52 
GeneralVS.NET dumps stack traces in outputdebugstring Pin
nidhogg27-May-03 23:01
membernidhogg27-May-03 23:01 
GeneralRe: VS.NET dumps stack traces in outputdebugstring Pin
Jerry Maguire28-May-03 1:01
memberJerry Maguire28-May-03 1:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151120.1 | Last Updated 27 May 2003
Article Copyright 2003 by Chris Richner
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid