dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

Every time i create a new project, the designer always gets stuck #8996

Closed benki111 closed 1 year ago

benki111 commented 1 year ago

Environment

image

.NET version

7.0

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

no

Issue description

every time i create a new project the designer immediately hangs up, and it stays like that for hours image

Steps to reproduce

create a new project, no matter what net version

Diagnostics

[19:48:57.383748] 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.
[19:48:57.384745] 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.
[19:48:57.393783] 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.<GetNetCoreProjectInfoAsync>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.<GetProjectInfoAsync>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.<CreateHostAsync>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.<CreateClientAsync>d__29.MoveNext()

                        For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[19:48:59.229331] warn: Cannot update selection in server process as Session is not connected.
elachlan commented 1 year ago

@Olina-Zhang can your team please verify this?

RussKie commented 1 year ago

I think this is @Shyam-Gupta's area of expertise.

Olina-Zhang commented 1 year ago

@Olina-Zhang can your team please verify this?

We cannot reproduce it. Let's see if @Shyam-Gupta has any output or need more information to customer.

Shyam-Gupta commented 1 year ago

@benki111 Could you please confirm if project can be built successfully after creating it? Also, are you able to create a WPF .NET project successfully and launch the designer? This will help us determine if it is a WinForms specific issue or not. Thanks.

Tanya-Solyanik commented 1 year ago

@benki111 - what framework are you targeting?

amasys46 commented 1 year ago

When creating a new app Winform desktop for .Net 7, I solved this "hang" problem by using this procedure:

  1. Create new app, close designer (it hangs!)
  2. Execute PM > dotnet restore
  3. Exit Vs2022
  4. Reload app
  5. Rename Form1.cs to MainForm.cs (or basically do something new)
  6. Debug or run app
  7. You should see your MainForm designer screen after 10 seconds! Mike McCullough mike@mccul.co
RussKie commented 1 year ago
  • Create new app, close designer (it hangs!)
  • Execute PM > dotnet restore
  • Exit Vs2022
  • Reload app
  • Rename Form1.cs to MainForm.cs (or basically do something new)

All of that shouldn't be necessary. What's the diagnostics output? https://aka.ms/winforms/designer/troubleshooting.

ghost commented 1 year ago

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.