diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/dotnetcli.host.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/dotnetcli.host.json
index 22ab4a3929f..3ba9f7c9be9 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/dotnetcli.host.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/dotnetcli.host.json
@@ -16,6 +16,10 @@
"langVersion": {
"longName": "langVersion",
"shortName": ""
+ },
+ "Nullable": {
+ "longName": "nullable",
+ "shortName": ""
}
},
"usageExamples": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json
index 224a8b56f1d..2785a48ed9e 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json
@@ -43,7 +43,7 @@
{
"choice": "net6.0",
"description": "Target net6.0"
- }
+ }
],
"replaces": "FrameworkParameter",
"defaultValue": "net6.0"
@@ -68,6 +68,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
+ },
+ "Nullable": {
+ "type": "parameter",
+ "datatype": "bool",
+ "defaultValue": "true",
+ "description": "Whether to enable nullable reference types for this project."
}
},
"primaryOutputs": [
@@ -76,7 +82,7 @@
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"path": "MainWindow.xaml.cs"
},
- {
+ {
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"path": "MainWindow.xaml"
}
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/Company.WpfApplication1.csproj b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/Company.WpfApplication1.csproj
index ae7f087a75b..7a268bdea17 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/Company.WpfApplication1.csproj
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/Company.WpfApplication1.csproj
@@ -6,6 +6,7 @@
TargetFrameworkOverride-windows
Company.WpfApplication1
$(ProjectLanguageVersion)
+ enable
true
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/dotnetcli.host.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/dotnetcli.host.json
index 22ab4a3929f..3ba9f7c9be9 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/dotnetcli.host.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/dotnetcli.host.json
@@ -16,6 +16,10 @@
"langVersion": {
"longName": "langVersion",
"shortName": ""
+ },
+ "Nullable": {
+ "longName": "nullable",
+ "shortName": ""
}
},
"usageExamples": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/template.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/template.json
index d4e3c8d4b32..64462a92f50 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/template.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/.template.config/template.json
@@ -68,6 +68,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
+ },
+ "Nullable": {
+ "type": "parameter",
+ "datatype": "bool",
+ "defaultValue": "true",
+ "description": "Whether to enable nullable reference types for this project."
}
},
"primaryOutputs": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/Company.ClassLibrary1.csproj b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/Company.ClassLibrary1.csproj
index 789f85656a8..39443dc822f 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/Company.ClassLibrary1.csproj
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfClassLibrary-CSharp/Company.ClassLibrary1.csproj
@@ -5,6 +5,7 @@
TargetFrameworkOverride-windows
Company.ClassLibrary1
$(ProjectLanguageVersion)
+ enable
true
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/dotnetcli.host.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/dotnetcli.host.json
index 22ab4a3929f..3ba9f7c9be9 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/dotnetcli.host.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/dotnetcli.host.json
@@ -16,6 +16,10 @@
"langVersion": {
"longName": "langVersion",
"shortName": ""
+ },
+ "Nullable": {
+ "longName": "nullable",
+ "shortName": ""
}
},
"usageExamples": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/template.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/template.json
index a48cd5a63af..362b281a80d 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/template.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/.template.config/template.json
@@ -68,6 +68,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
+ },
+ "Nullable": {
+ "type": "parameter",
+ "datatype": "bool",
+ "defaultValue": "true",
+ "description": "Whether to enable nullable reference types for this project."
}
},
"primaryOutputs": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/Company.WpfCustomControlLibrary.csproj b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/Company.WpfCustomControlLibrary.csproj
index 33945934b95..de80086d2a9 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/Company.WpfCustomControlLibrary.csproj
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfCustomControlLibrary-CSharp/Company.WpfCustomControlLibrary.csproj
@@ -5,6 +5,7 @@
TargetFrameworkOverride-windows
Company.WpfCustomControlLibrary
$(ProjectLanguageVersion)
+ enable
true
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/dotnetcli.host.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/dotnetcli.host.json
index 22ab4a3929f..3ba9f7c9be9 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/dotnetcli.host.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/dotnetcli.host.json
@@ -16,6 +16,10 @@
"langVersion": {
"longName": "langVersion",
"shortName": ""
+ },
+ "Nullable": {
+ "longName": "nullable",
+ "shortName": ""
}
},
"usageExamples": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/template.json b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/template.json
index 69e28b1491c..8f8da7c587b 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/template.json
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/.template.config/template.json
@@ -68,6 +68,12 @@
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
+ },
+ "Nullable": {
+ "type": "parameter",
+ "datatype": "bool",
+ "defaultValue": "true",
+ "description": "Whether to enable nullable reference types for this project."
}
},
"primaryOutputs": [
diff --git a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/Company.WpfControlLibrary.csproj b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/Company.WpfControlLibrary.csproj
index 7b1312c1b95..9a6de4c00ad 100644
--- a/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/Company.WpfControlLibrary.csproj
+++ b/packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfUserControlLibrary-CSharp/Company.WpfControlLibrary.csproj
@@ -5,6 +5,7 @@
TargetFrameworkOverride-windows
Company.WpfControlLibrary
$(ProjectLanguageVersion)
+ enable
true