dotnet / winforms

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

Re-occurrence of WinForms designer failing to load #10352

Open jwilo opened 11 months ago

jwilo commented 11 months ago

Environment

Visual Studio Version 17.8.0

.NET version

8.0.0

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

I have had this issue in the past under .NET 5 & 6 as per https://github.com/dotnet/winforms/issues/6492

However, .NET 8 has been working just fine since converting a project to 8 several weeks ago. I have been working on this project non stop for weeks, until this occurred just now.

Issue description

Exactly as per closed issue https://github.com/dotnet/winforms/issues/6492

I have been working on this project for weeks, with minor occurrences of behaviour I have witness across multiple machines, and multiple VS versions for years - where jumping between code/designer views, often the designer tab will actually display the code, and closing/reloading the designer view resolves the issue.

However, loading the project this morning I am unable to open the design. VS and the machine were shut down correctly, and nobody else has touched this (all files saved locally).

Steps to reproduce

Unfortunately I have no idea how to reproduce the issue, as it has just re-occurred seemingly out of nowhere. In my case, it occurred loading the project again this morning, having been working on it for weeks.

I have attempted to generate logs by following https://github.com/dotnet/winforms/issues/6492#issuecomment-1010310024 but absolutely nothing is generated.

I can open a different solution (.NET 6), and the designer loads just fine.

Now, most interesting - I've closing that other solution, jumped back to the problematic solution, and the designer now loads just fine? Even though before I've closed and re-opened the solution, and VS< and the machine several times. Now that he designer has loaded, the log contains many entries.

Diagnostics

No response

jwilo commented 11 months ago

Hi @merriemcgaw @Shyam-Gupta - hope you're both well. Does this issue having been added to the above milestone mean it is recognised internally as an issue? Has it been found to be reproducible your end?

This seems to be getting worse and worse it the project I'm currently working on, as it grows in size rapidly.

merriemcgaw commented 11 months ago

@jwilo we are looking at all causes we can of the designer failing to load. Without any logs it's really difficult to know what the specific cause may be. Does it time out and fail, or are you stuck at the loading message, with nothing going to the output window (set to show WinForms logs)? My recommendation is that you record a gif if you can and create a VS Developer Community ticket using the VS feedback system. That will generate a lot more diagnostic information for us to investigate with and then we can dig into the specifics of what you're experiencing. If this is something that is impacting a lot of people you'll see votes in the feedback and you will get direct attention of the VS team. This repo is mostly the runtime, though we do keep some issues open so the community can see more of what we're doing.

One thing you will be happy to know is that in the upcoming preview of 17.9 we addressed the tab switching issue in part. We're following up that work with a complete fix by the time 17.9 is a GA product.

@Olina-Zhang can your team repro this is 17.8 GA?

jwilo commented 11 months ago

It never times out, but just continues to display the loading message. A related issue I have noticed, is when this occurs - right clicking on an item and clicking 'Show Code' instead of 'Show Designer', also brings up the tab that is trying to load the designer.

Next time this occurs, I will try and make a GIF that doesn't reveal what I'm actually working on, as I'm not in a position to release that for another few months.

Great news on the tab switching issue (assuming you're talking about the issue where you switch to a designer tab, and still see the code?), as this is a constantly battle with it occurring far more often than not with multiple tabs open... that'll be such an improvement day to day! Great work :)