Roslyn: Form1.cs doesn't get recognized as designer file for new WinForms .NET Core projects

Created on 26 Jun 2020  路  4Comments  路  Source: dotnet/roslyn

Version Used:

VS IntPreview build: 16.7.0 Preview 4.0 [30224.187.master]

Steps to Reproduce:

  1. In latest VS IntPreview build, create a new WinForms .NET Core project.
    (Note that this bug doesn't repro on opening an existing project.)
  2. Notice that Form1.cs opens up in code editor rather than designer
  3. Wait for Form1.cs icon to change to that of a designer

Expected Behavior:
Form1.cs should get recognized as a designer file quickly after a new WinForms .NET Core project gets created.

Actual Behavior:
It takes a lot of time for Form1.cs to get recognized as a WinForms designer file. Sometimes it does not get recognized at all. During this time the user is completely blocked as there is no way to open the designer.

Area-IDE Bug Regression Resolution-Fixed

All 4 comments

I don't repro this on Version 16.7.0 Preview 3.0. We correctly report the designer attribute after a reasonable time. On my machine that's about 15 seconds after project creation. This happens due to us waiting for other work to settle down and for us to enter into our background processing mode.

The problem is in not working mechanics of discovery forms if thy are not in *.csproj.user or the file is absent.
Issue with new project is related to https://github.com/dotnet/winforms/issues/3510
But without *.csproj.user (new project, pull from repo etc...) or if form is absent in it, things are completely broken: https://github.com/dotnet/winforms/issues/3619#issuecomment-663476629.

Yeah, this is taking several minutes for some larger projects after git clean, and other projects never get the icon at all (after leaving it for hours). It doesn't seem consistent. Some projects have issues only half the time after a git clean.

We believe this should be fixed for 16.8 with these two PRs:

https://github.com/dotnet/roslyn/pull/46391
https://github.com/dotnet/roslyn/pull/46426

Was this page helpful?
0 / 5 - 0 ratings