Skip to content

Windows Forms templates should carry proj.user with SubType already set #3510

@davkean

Description

@davkean

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"

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Compile Update="Form1.cs">
      <SubType>Form</SubType>
    </Compile>
  </ItemGroup>
</Project>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions