-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Forms templates should carry proj.user with SubType already set #3510
Comments
Does this really make any difference? VS ignores Can't this be stored somewhere that is persisted properly? Its not really a user setting ... |
Yes it makes a difference in this scenario, hence why I filed this. |
I'd argue a solution that works more than once would be better. This suggestion just works at project creation and never again for anyone else who starts working on the project. So it makes a difference for one person one time, not really a difference in the long term. (I'm not going to keep arguing, just my opinion here, to suggest considering alternatives.) |
Legacy does the same thing with its templates (carries subtype), so regardless of whether there is a better solution to putting subtype in the user file, we are still going to be carrying it in the template. |
To detect that a Forms is openable by the designer (and gets the icon), Roslyn asynchronously reads the attributes of a type's base types and pushes a "SubType" if the right attribute is present to the project system. Which in turn, causes the designer paths to light up. This is a slow and asynchronous process and cannot be blocked on, and causes additional evaluations and design-time builds to kicked off after Roslyn sets the subtype. To side step this whole process, and improve the speed for opening the designer and to reduce the number of design-builds that are needed for File -> New, the templates should carry this information and have the project system automatically recognize that this project contains a designable file. Resolves dotnet#3510
Verified the issue with latest .NET 5.0 SDK, the Form1.cs[Design] page is opened directly and have the below code section generated in the .csproj.user file. see below GIF. however noticed that the spending time to open Form1.cs[Design] is still longer than Framework project. |
It takes longer because it performs a NuGet restore, which legacy does not. |
Problem description:
To detect that a Forms is openable by the designer (and gets the icon), Roslyn asynchronously reads the attributes of a type's base types and pushes a "SubType" if the right attribute is present to the project system. Which in turn, causes the designer paths to light up.
This is a slow and asynchronous process and cannot be blocked on, and causes additional evaluations and design-time builds to kicked off after Roslyn sets the subtype.
To side step this whole process, and improve the speed for opening the designer and to reduce the number of design-builds that are needed for File -> New, the templates should carry this information and have the project system automatically recognize that this project contains a designable file.
To do that, carry a UTF8-with BOM file alongside the project called "[Project].csproj.user"
The text was updated successfully, but these errors were encountered: