From 9b89d7f3918a385fa2022c2f44725e1571f1c94d Mon Sep 17 00:00:00 2001 From: Scott Jones Date: Tue, 9 Jul 2024 11:51:41 -0700 Subject: [PATCH] enable nullable reference types on new projects (.NET guidance) and fix warning (#4539) --- .../Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs | 2 +- .../Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj | 1 + .../Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs | 2 +- .../CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj | 1 + .../Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj | 1 + .../Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs | 2 +- 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs index d7fc6993bc..b6488bd6bc 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs @@ -45,6 +45,6 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar m_window.Activate(); } - private Window m_window; + private Window? m_window; } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj index 73dd366291..353e7ee64d 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj @@ -9,6 +9,7 @@ win-x86;win-x64;win-arm64 win10-x86;win10-x64;win10-arm64 true + enable diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs index d7fc6993bc..b6488bd6bc 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs @@ -45,6 +45,6 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar m_window.Activate(); } - private Window m_window; + private Window? m_window; } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj index b6f1bba009..8bf68d7d23 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj @@ -11,6 +11,7 @@ win-$(Platform).pubxml true true + enable diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj index 914389e510..d827e4f79d 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj @@ -11,6 +11,7 @@ win-$(Platform).pubxml true true + enable diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs index 458446adfe..9c6071da2f 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs +++ b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs @@ -52,6 +52,6 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine); } - private Window m_window; + private Window? m_window; } }