You are currently offline, waiting for your internet to reconnect

Form Height and Width changes with Visual Studio 2012

Developers debugging existing WinForms applications (targeting .NET 4.0 or older) or upgrading those applications to target .NET 4.5 (or newer) may notice changes in the Height and Width of some Forms.

Example of original behavior:
Running outside the Visual Studio debugger

Example of new behavior:
Running under the Visual Studio debugger
In order to take advantage of new Windows operating system features, a decision was made to change all Visual Studio processes to use Windows subsystem version 6.00. Also, new applications targeting .NET 4.5 (or newer) will target Windows subsystem version 6.00 (or greater) by default.
Developers who are impacted by incorrect Form Height and Width when executing under the Visual Studio debugger may work around the issue by turning off the Visual Studio Debugger Hosting Process (vshost). This may be accomplished by doing one of the following:
  • Unchecking "Enable the Visual Studio hosting process" in their project's properties (Project Properties... Debug tab)
  • Setting the environment variable UseVSHostingProcess=false before starting Visual Studio

Developers who change their application to target .NET 4.5 (or newer) may need to either:
  • Change their source code to account for the differences in Form Height and Width.
  • Specify subsystem version 4.00 by adding <SubsystemVersion>4.00</SubsystemVersion> to their project file or by using the /subystemversion:4.00 compiler switch.

More information
Disabling the Visual Studio hosting process may have a negative impact on the debugger startup performance.
WinForms Form Height Width different incorrect changes Visual Studio vshost debugger .NET 4.5
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 2877623 - Last Review: 08/21/2013 21:20:00 - Revision: 1.0

Microsoft Visual Studio 2013 Preview, Microsoft Visual Studio Premium 2012, Microsoft Visual Studio Premium 2013 Preview, Microsoft Visual Studio Professional 2012, Microsoft Visual Studio Professional 2013 Preview

  • KB2877623