Skip to content

Commit febfa3f

Browse files
authored
Merge pull request #113 from egvijayanand/working
Templates updated to support .NET 10 Preview
2 parents 9897e85 + ebd389a commit febfa3f

File tree

38 files changed

+238
-86
lines changed

38 files changed

+238
-86
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2024 Vijay Anand E G
3+
Copyright (c) 2021-2025 Vijay Anand E G
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ So, .NET CLI command to create a new project from your favorite terminal would b
9393

9494
By default, this creates a project that targets `.NET 9`.
9595

96-
To create projects targeting different supported version of .NET, make use of the Framework parameter (`--framework` | `-f`) that takes `net8.0` / `net9.0` as its options (with `net9.0` being the default value, if not specified).
96+
To create projects targeting different supported/preview version of .NET, make use of the Framework parameter (`--framework` | `-f`) that takes `net8.0` / `net9.0` / `net10.0` as its options (with `net9.0` being the default value, if not specified).
9797

9898
WinForms:
9999

@@ -107,6 +107,12 @@ dotnet new winforms-blazor
107107
dotnet new winforms-blazor -f net8.0
108108
```
109109

110+
.NET 10 Preview:
111+
112+
```shell
113+
dotnet new winforms-blazor -f net10.0
114+
```
115+
110116
WPF:
111117

112118
Being the default value, framework parameter is optional for `.NET 9`.
@@ -119,6 +125,12 @@ dotnet new wpf-blazor
119125
dotnet new wpf-blazor -f net8.0
120126
```
121127

128+
.NET 10 Preview:
129+
130+
```shell
131+
dotnet new wpf-blazor -f net10.0
132+
```
133+
122134
Optionally, to abstract Razor components as a separate Razor Class Library (RCL), pass the below parameter while creating the project:
123135

124136
`-rcl` | `--razor-class-library` - Default value is `false`
@@ -151,7 +163,7 @@ For WPF:
151163
dotnet new wpf-blazor -cpm
152164
```
153165

154-
Project options can also be used in combination like `-rcl` and `-cpm`.
166+
Project options can also be used in combination like `-rcl`, `-cpm`, and `-slnx`.
155167

156168
Has support for Item Templates too:
157169

src/BlazorTemplatesCLI/BlazorWinForms/.template.config/dotnetcli.host.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
"use-slnx": {
88
"shortName": "slnx"
99
}
10-
}
10+
},
11+
"usageExamples": [
12+
"--framework net8.0",
13+
"-f net10.0"
14+
]
1115
}

src/BlazorTemplatesCLI/BlazorWinForms/.template.config/template.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"datatype": "choice",
3232
"description": "Option to choose the application target framework.",
3333
"choices": [
34+
{
35+
"choice": "net10.0",
36+
"description": "Target .NET 10",
37+
"displayName": ".NET 10 (Preview)"
38+
},
3439
{
3540
"choice": "net9.0",
3641
"description": "Target .NET 9",
@@ -50,7 +55,7 @@
5055
"datatype": "bool",
5156
"defaultValue": "false",
5257
"description": "Option to use XML-based solution file (slnx).",
53-
"displayName": "Option to use XML-based solution file (sln_x)"
58+
"displayName": "Option to use _XML-based solution file (slnx)"
5459
},
5560
"central-pkg-mgmt": {
5661
"type": "parameter",
@@ -81,6 +86,10 @@
8186
"toLower": true
8287
}
8388
},
89+
"Net10": {
90+
"type": "computed",
91+
"value": "(frameworkLower == \"net10.0\")"
92+
},
8493
"Net9": {
8594
"type": "computed",
8695
"value": "(frameworkLower == \"net9.0\")"

src/BlazorTemplatesCLI/BlazorWinForms/BlazorWinForms.1.RazorLib/BlazorWinForms.1.RazorLib.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
<!--#if (CentralPkgMgmt)-->
2020
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
2121
<!--#else-->
22-
<!--#if (Net9)-->
23-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.*" />
24-
<!--#else-->
22+
<!--#if (Net10)-->
23+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.*-*" />
24+
<!--#elif (Net8)-->
2525
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.*" />
26+
<!--#else-->
27+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.*" />
2628
<!--#endif-->
2729
<!--#endif-->
2830
</ItemGroup>

src/BlazorTemplatesCLI/BlazorWinForms/BlazorWinForms.1.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@
3535
<PackageReference Include="CommunityToolkit.Mvvm" />
3636
<!--#endif-->
3737
<!--#else-->
38-
<!--#if (Net9)-->
39-
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="9.*" />
40-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.*" />
41-
<!--#else-->
38+
<!--#if (Net10)-->
39+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="10.*-*" />
40+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.*-*" />
41+
<!--#elif (Net8)-->
4242
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="8.*" />
4343
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.*" />
44+
<!--#else-->
45+
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="9.*" />
46+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.*" />
4447
<!--#endif-->
4548
<!--#if (AddMvvmToolkit)-->
4649
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.*" />

src/BlazorTemplatesCLI/BlazorWinForms/Directory.Packages.props

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
<!--#if (Net9)-->
7-
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.0" />
8-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="9.0.10" />
9-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
10-
<!--#else-->
11-
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.11" />
6+
<!--#if (Net10)-->
7+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.0-preview.2.25164.1" />
8+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="10.0.0-preview.2.25165.1" />
9+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.2.25163.2" />
10+
<!--#elif (Net8)-->
11+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.14" />
1212
<PackageVersion Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="8.0.100" />
1313
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
14+
<!--#else-->
15+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.3" />
16+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebView.WindowsForms" Version="9.0.50" />
17+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.3" />
1418
<!--#endif-->
1519
<!--#if (AddMvvmToolkit)-->
16-
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.3.2" />
20+
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
1721
<!--#endif-->
1822
</ItemGroup>
1923
</Project>

src/BlazorTemplatesCLI/BlazorWpf/.template.config/dotnetcli.host.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
"use-slnx": {
88
"shortName": "slnx"
99
}
10-
}
10+
},
11+
"usageExamples": [
12+
"--framework net8.0",
13+
"-f net10.0"
14+
]
1115
}

src/BlazorTemplatesCLI/BlazorWpf/.template.config/template.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"datatype": "choice",
3232
"description": "Option to choose the application target framework.",
3333
"choices": [
34+
{
35+
"choice": "net10.0",
36+
"description": "Target .NET 10",
37+
"displayName": ".NET 10 (Preview)"
38+
},
3439
{
3540
"choice": "net9.0",
3641
"description": "Target .NET 9",
@@ -50,7 +55,7 @@
5055
"datatype": "bool",
5156
"defaultValue": "false",
5257
"description": "Option to use XML-based solution file (slnx).",
53-
"displayName": "Option to use XML-based solution file (sln_x)"
58+
"displayName": "Option to use _XML-based solution file (slnx)"
5459
},
5560
"central-pkg-mgmt": {
5661
"type": "parameter",
@@ -81,6 +86,10 @@
8186
"toLower": true
8287
}
8388
},
89+
"Net10": {
90+
"type": "computed",
91+
"value": "(frameworkLower == \"net10.0\")"
92+
},
8493
"Net9": {
8594
"type": "computed",
8695
"value": "(frameworkLower == \"net9.0\")"

src/BlazorTemplatesCLI/BlazorWpf/BlazorWpf.1.RazorLib/BlazorWpf.1.RazorLib.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
<!--#if (CentralPkgMgmt)-->
2020
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
2121
<!--#else-->
22-
<!--#if (Net9)-->
23-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.*" />
24-
<!--#else-->
22+
<!--#if (Net10)-->
23+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.*-*" />
24+
<!--#elif (Net8)-->
2525
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.*" />
26+
<!--#else-->
27+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.*" />
2628
<!--#endif-->
2729
<!--#endif-->
2830
</ItemGroup>

0 commit comments

Comments
 (0)