Skip to content

Commit bf46234

Browse files
committed
Add support for .NET 9.0 web project templates
1 parent 3684341 commit bf46234

File tree

4 files changed

+81
-73
lines changed

4 files changed

+81
-73
lines changed

test/dotnet-new.Tests/Approvals/WebProjectsTests.CanShowHelp_Mvc.verified.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ Template options:
6868
-uld, --use-local-db Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.
6969
Type: bool
7070
Default: false
71-
-f, --framework <net10.0|net6.0|net7.0|net8.0> The target framework for the project.
71+
-f, --framework <net10.0|net6.0|net7.0|net8.0|net9.0> The target framework for the project.
7272
Type: choice
7373
net10.0 Target net10.0
74+
net9.0 Target net9.0
7475
net8.0 Target net8.0
7576
net7.0 Target net7.0
7677
net6.0 Target net6.0

test/dotnet-new.Tests/Approvals/WebProjectsTests.CanShowHelp_WebAPI.verified.txt

Lines changed: 72 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,78 @@ Options:
1616
--type <project> Specifies the template type to instantiate.
1717

1818
Template options:
19-
-au, --auth <IndividualB2C|None|SingleOrg|Windows> The type of authentication to use
20-
Type: choice
21-
None No authentication
22-
IndividualB2C Individual authentication with Azure AD B2C
23-
SingleOrg Organizational authentication for a single tenant
24-
Windows Windows authentication
25-
Default: None
26-
--aad-b2c-instance <aad-b2c-instance> The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth).
27-
Type: string
28-
Default: https://qualified.domain.name.b2clogin.com/
29-
-ssp, --susi-policy-id <susi-policy-id> The sign-in and sign-up policy ID for this project (use with IndividualB2C auth).
30-
Type: string
31-
Default: b2c_1_susi
32-
--aad-instance <aad-instance> The Azure Active Directory instance to connect to (use with SingleOrg auth).
33-
Type: string
34-
Default: https://login.microsoftonline.com/
35-
--client-id <client-id> The Client ID for this project (use with SingleOrg or IndividualB2C auth).
36-
Type: string
37-
Default: 11111111-1111-1111-11111111111111111
38-
--domain <domain> The domain for the directory tenant (use with SingleOrg or IndividualB2C auth).
39-
Type: string
40-
Default: qualified.domain.name
41-
--default-scope <default-scope> The API scope the client needs to request to provision an access token. (use with IndividualB2C, SingleOrg).
42-
Type: string
43-
Default: access_as_user
44-
--tenant-id <tenant-id> The TenantId ID of the directory to connect to (use with SingleOrg auth).
45-
Type: string
46-
Default: 22222222-2222-2222-2222-222222222222
47-
-r, --org-read-access Whether or not to allow this application read access to the directory (only applies to SingleOrg auth).
48-
Type: bool
49-
Default: false
50-
--exclude-launch-settings Whether to exclude launchSettings.json in the generated template.
51-
Type: bool
52-
Default: false
53-
--no-https Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.
54-
Type: bool
55-
Default: false
56-
-uld, --use-local-db Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.
57-
Type: bool
58-
Default: false
59-
-f, --framework <net10.0|net6.0|net7.0|net8.0> The target framework for the project.
60-
Type: choice
61-
net10.0 Target net10.0
62-
net8.0 Target net8.0
63-
net7.0 Target net7.0
64-
net6.0 Target net6.0
65-
Default: net10.0
66-
--no-restore If specified, skips the automatic restore of the project on create.
67-
Type: bool
68-
Default: false
69-
--called-api-url <called-api-url> URL of the API to call from the web app. This option only applies if --auth SingleOrg or --auth IndividualB2C is specified.
70-
Type: string
71-
Default: https://graph.microsoft.com/v1.0
72-
--calls-graph Specifies if the web app calls Microsoft Graph. This option only applies if --auth SingleOrg is specified.
73-
Type: bool
74-
Default: false
75-
--called-api-scopes <called-api-scopes> Scopes to request to call the API from the web app. This option only applies if --auth SingleOrg or --auth IndividualB2C is specified.
76-
Type: string
77-
Default: user.read
78-
--no-openapi Disable OpenAPI (Swagger) support
79-
Type: bool
80-
Default: false
81-
--use-program-main Whether to generate an explicit Program class and Main method instead of top-level statements.
82-
Type: bool
83-
Default: false
84-
-controllers, --use-controllers Whether to use controllers instead of minimal APIs. This option overides the value specified by --minimal.
85-
Type: bool
86-
Default: false
87-
-minimal, --use-minimal-apis Whether to use minimal APIs instead of controllers.
88-
Type: bool
89-
Default: false
19+
-au, --auth <IndividualB2C|None|SingleOrg|Windows> The type of authentication to use
20+
Type: choice
21+
None No authentication
22+
IndividualB2C Individual authentication with Azure AD B2C
23+
SingleOrg Organizational authentication for a single tenant
24+
Windows Windows authentication
25+
Default: None
26+
--aad-b2c-instance <aad-b2c-instance> The Azure Active Directory B2C instance to connect to (use with IndividualB2C auth).
27+
Type: string
28+
Default: https://qualified.domain.name.b2clogin.com/
29+
-ssp, --susi-policy-id <susi-policy-id> The sign-in and sign-up policy ID for this project (use with IndividualB2C auth).
30+
Type: string
31+
Default: b2c_1_susi
32+
--aad-instance <aad-instance> The Azure Active Directory instance to connect to (use with SingleOrg auth).
33+
Type: string
34+
Default: https://login.microsoftonline.com/
35+
--client-id <client-id> The Client ID for this project (use with SingleOrg or IndividualB2C auth).
36+
Type: string
37+
Default: 11111111-1111-1111-11111111111111111
38+
--domain <domain> The domain for the directory tenant (use with SingleOrg or IndividualB2C auth).
39+
Type: string
40+
Default: qualified.domain.name
41+
--default-scope <default-scope> The API scope the client needs to request to provision an access token. (use with IndividualB2C, SingleOrg).
42+
Type: string
43+
Default: access_as_user
44+
--tenant-id <tenant-id> The TenantId ID of the directory to connect to (use with SingleOrg auth).
45+
Type: string
46+
Default: 22222222-2222-2222-2222-222222222222
47+
-r, --org-read-access Whether or not to allow this application read access to the directory (only applies to SingleOrg auth).
48+
Type: bool
49+
Default: false
50+
--exclude-launch-settings Whether to exclude launchSettings.json in the generated template.
51+
Type: bool
52+
Default: false
53+
--no-https Whether to turn off HTTPS. This option only applies if IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.
54+
Type: bool
55+
Default: false
56+
-uld, --use-local-db Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.
57+
Type: bool
58+
Default: false
59+
-f, --framework <net10.0|net6.0|net7.0|net8.0|net9.0> The target framework for the project.
60+
Type: choice
61+
net10.0 Target net10.0
62+
net9.0 Target net9.0
63+
net8.0 Target net8.0
64+
net7.0 Target net7.0
65+
net6.0 Target net6.0
66+
Default: net10.0
67+
--no-restore If specified, skips the automatic restore of the project on create.
68+
Type: bool
69+
Default: false
70+
--called-api-url <called-api-url> URL of the API to call from the web app. This option only applies if --auth SingleOrg or --auth IndividualB2C is specified.
71+
Type: string
72+
Default: https://graph.microsoft.com/v1.0
73+
--calls-graph Specifies if the web app calls Microsoft Graph. This option only applies if --auth SingleOrg is specified.
74+
Type: bool
75+
Default: false
76+
--called-api-scopes <called-api-scopes> Scopes to request to call the API from the web app. This option only applies if --auth SingleOrg or --auth IndividualB2C is specified.
77+
Type: string
78+
Default: user.read
79+
--no-openapi Disable OpenAPI (Swagger) support
80+
Type: bool
81+
Default: false
82+
--use-program-main Whether to generate an explicit Program class and Main method instead of top-level statements.
83+
Type: bool
84+
Default: false
85+
-controllers, --use-controllers Whether to use controllers instead of minimal APIs. This option overides the value specified by --minimal.
86+
Type: bool
87+
Default: false
88+
-minimal, --use-minimal-apis Whether to use minimal APIs instead of controllers.
89+
Type: bool
90+
Default: false
9091

9192
To see help for other template languages (F#), use --language option:
9293
dotnet new webapi -h --language F#

test/dotnet-new.Tests/Approvals/WebProjectsTests.CanShowHelp_Webapp_common.verified.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ Template options:
7272
-uld, --use-local-db Whether to use LocalDB instead of SQLite. This option only applies if --auth Individual or --auth IndividualB2C is specified.
7373
Type: bool
7474
Default: false
75-
-f, --framework <net10.0|net6.0|net7.0|net8.0> The target framework for the project.
75+
-f, --framework <net10.0|net6.0|net7.0|net8.0|net9.0> The target framework for the project.
7676
Type: choice
7777
net10.0 Target net10.0
78+
net9.0 Target net9.0
7879
net8.0 Target net8.0
7980
net7.0 Target net7.0
8081
net6.0 Target net6.0

test/dotnet-new.Tests/WebProjectsTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public WebProjectsTests(WebProjectsFixture fixture, ITestOutputHelper log) : bas
3333
[InlineData("mvc_cs-80", "mvc", "-f", "net8.0")]
3434
[InlineData("mvc_fs-80", "mvc", "-lang", "F#", "-f", "net8.0")]
3535
[InlineData("api_cs-80", "webapi", "-f", "net8.0")]
36+
[InlineData("emptyweb_cs-90", "web", "-f", "net9.0")]
37+
[InlineData("mvc_cs-90", "mvc", "-f", "net9.0")]
38+
[InlineData("mvc_fs-90", "mvc", "-lang", "F#", "-f", "net9.0")]
39+
[InlineData("api_cs-90", "webapi", "-f", "net9.0")]
3640
public void AllWebProjectsRestoreAndBuild(string testName, params string[] args)
3741
{
3842
string workingDir = Path.Combine(_fixture.BaseWorkingDirectory, testName);
@@ -133,6 +137,7 @@ public WebProjectsFixture(IMessageSink messageSink) : base(messageSink)
133137
InstallPackage(TemplatePackagesPaths.MicrosoftDotNetWebProjectTemplates60Path, BaseWorkingDirectory);
134138
InstallPackage(TemplatePackagesPaths.MicrosoftDotNetWebProjectTemplates70Path, BaseWorkingDirectory);
135139
InstallPackage(TemplatePackagesPaths.MicrosoftDotNetWebProjectTemplates80Path, BaseWorkingDirectory);
140+
InstallPackage(TemplatePackagesPaths.MicrosoftDotNetWebProjectTemplates90Path, BaseWorkingDirectory);
136141
}
137142

138143
internal string BaseWorkingDirectory { get; private set; }

0 commit comments

Comments
 (0)