-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update template to use TFM-based sources; enabled latest lang features #5609
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>WinExe</OutputType> | ||
| <TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">FrameworkParameter-windows</TargetFramework> | ||
| <TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride-windows</TargetFramework> | ||
| <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WinFormsApplication1</RootNamespace> | ||
| <LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion> | ||
| <Nullable Condition="'$(Nullable)' == 'true'">enable</Nullable> | ||
| <UseWindowsForms>true</UseWindowsForms> | ||
| <ImplicitUsings Condition="'$(csharpFeature_ImplicitUsings)' == 'true'">enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?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> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #if (!csharpFeature_ImplicitUsings) | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Data; | ||
| using System.Drawing; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using System.Windows.Forms; | ||
|
|
||
| #endif | ||
| #if (csharpFeature_FileScopedNamespaces) | ||
| namespace Company.WinFormsApplication1; | ||
|
||
|
|
||
| public partial class Form1 : Form | ||
| { | ||
| public Form1() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
| } | ||
| #else | ||
| namespace Company.WinFormsApplication1 | ||
| { | ||
| public partial class Form1 : Form | ||
| { | ||
| public Form1() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #if (!csharpFeature_ImplicitUsings) | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Threading.Tasks; | ||
| using System.Windows.Forms; | ||
|
|
||
| #endif | ||
| #if (csharpFeature_FileScopedNamespaces) | ||
| namespace Company.WinFormsApplication1; | ||
|
|
||
| static class Program | ||
| { | ||
| /// <summary> | ||
| /// The main entry point for the application. | ||
| /// </summary> | ||
| [STAThread] | ||
| static void Main() | ||
| { | ||
| ApplicationConfiguration.Initialize(); | ||
| Application.Run(new Form1()); | ||
| } | ||
| } | ||
| #else | ||
| namespace Company.WinFormsApplication1 | ||
| { | ||
| static class Program | ||
| { | ||
| /// <summary> | ||
| /// The main entry point for the application. | ||
| /// </summary> | ||
| [STAThread] | ||
| static void Main() | ||
| { | ||
| ApplicationConfiguration.Initialize(); | ||
| Application.Run(new Form1()); | ||
| } | ||
| } | ||
| } | ||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?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> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Data; | ||
| using System.Drawing; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using System.Windows.Forms; | ||
|
|
||
| namespace Company.WinFormsApplication1 | ||
| { | ||
| public partial class Form1 : Form | ||
| { | ||
| public Form1() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want this to show up in the project file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, has a lower case
lThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a command line argument and aligns with this:
winforms/pkg/Microsoft.Dotnet.WinForms.ProjectTemplates/content/WinFormsApplication-CSharp/.template.config/template.json
Lines 52 to 59 in 07f6de3
The command line args are case sensitive:

There's an open tracking issue for this dotnet/templating#3237