Skip to content

Designer crashes when running Visual Studio 17.7.0 as a DpiUnaware process #9714

@rafcolson

Description

@rafcolson

Environment

Version 17.7.0

.NET version

.NET 6.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

Same issue as described in #7609. Reemerged after the last update released on August 8th, 2023 (Visual Studio 2022 version 17.7).

Issue description

In order to run VS in DpiUnaware mode, I use this registry setting:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\devenv.exe"="DPIUNAWARE"

Having added the key and value to the registry, VS fails to launch the designer when viewing the form's designer in my solution, throwing this error:

[15:35:39.852848] fail: [MyProject]: Failed to launch design tools server process process
                        System.InvalidOperationException: Failed to set process DPI mode value to: DpiUnaware.
                           at Microsoft.WinForms.Utilities.Desktop.DpiHelper.SetDesignerProcessDpiAwareness(DpiAwarenessContext dpiContext)
                           at Microsoft.DotNet.DesignTools.Server.Program.<>c__DisplayClass2_0.<<Main>b__1>d.MoveNext()

                        For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.

Steps to reproduce

  • add key and value to the registry
  • open solution
  • view the form's designer (Right-click on the form and choose "View Designer")

Diagnostics

No response

Metadata

Metadata

Assignees

Labels

💥 regression-previewRegression from a preview releasearea-VSDesignerWindows Forms out-of-proc designer related issuespriority-0Work that we can't release without

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions