Re-occurrence of WinForms designer failing to load (was #8996)
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 1.1k
- Avg merge
- 1d 13m
- Merged PRs (30d)
- 85
Description
### Environment
Microsoft Visual Studio Professional 2022
Version 17.8.6
VisualStudio.17.Release/17.8.6+34525.116
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Professional
C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects
NuGet Package Manager 6.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Visual Basic Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
Windows 10 Pro, Version 21H2, Installed 11/9/2022, build # 19044.3086.
### .NET version
.NET 8.0 (just updated today 4/9/2024)
### Did this work in a previous version of Visual Studio and/or previous .NET release?
No... first project targeting .NET 8
### Issue description
This is an exact copy of the issue #8996. Same behavior (exception prevents designer form loading on creation of any .NET 6.0 or 8.0 project), same error messages (every character!), and I was able to get it working using the convoluted procedure given in the replies to that issue.
I've worked around it this time, but I wanted you to know the propblem is still alive and well and impacting users.
### Steps to reproduce
It happened EVERY time I created a new Project/Solution with the option "Windows Forms App [C#]". I tried a total of 6 different Projects, 4 w/ NET 8.0, 2 with NET 6.0, with different names and folder locations. I did not modify any of the auto-generated code or other files.
**DISCOVERY:** I tried it again while preparing this report, and this time I **UNchecked** the "Place solution and project in the same directory" option, and _it worked right!_ Then I created one more project, with the box **checked** again, and it _failed_ in the same manner. That option seems to matter for some reason.
### Diagnostics
```text
Here are the contents of the Output Window immediately after opening the Project/Solution for the first time:
[17:14:47.443540] fail: OutputGroupService didn't return output group DesignerRuntimeImplementationProjectOutputGroup.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[17:14:47.444616] fail: Could not retrieve DesignerRuntimeImplementationProjectOutputGroup for current project.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[17:14:47.451539] fail: System.InvalidOperationException: Designer load encountered an error. Please ensure that the project can be built successfully.
at Microsoft.DotNet.DesignTools.Client.Host.ProjectInfoProvider.NetCore.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ProjectInfoProvider.d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ServerHostFactory.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.d__29.MoveNext()
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[17:14:47.782137] warn: Cannot update selection in server process as Session is not connected.
```
Contributor guide
Assessment
This issue has not been assessed yet.