]
33 | member this.Delete(id:int) =
34 | ()
35 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-FSharp/Startup.fs:
--------------------------------------------------------------------------------
1 | namespace Company.WebApplication1
2 |
3 | open System
4 | open Microsoft.AspNetCore.Builder
5 | open Microsoft.AspNetCore.Hosting
6 | open Microsoft.AspNetCore.Http
7 | open Microsoft.Extensions.DependencyInjection
8 |
9 | type Startup() =
10 |
11 | // This method gets called by the runtime. Use this method to add services to the container.
12 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
13 | member this.ConfigureServices(services: IServiceCollection) =
14 | ()
15 |
16 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
17 | member this.Configure(app: IApplicationBuilder, env: IHostingEnvironment) =
18 | if env.IsDevelopment() then
19 | app.UseDeveloperExceptionPage() |> ignore
20 |
21 | app.Run(fun context -> context.Response.WriteAsync("Hello World!")) |> ignore
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model ErrorViewModel
2 | @{
3 | ViewData["Title"] = "Error";
4 | }
5 |
6 | Error.
7 | An error occurred while processing your request.
8 |
9 | @if (Model.ShowRequestId)
10 | {
11 |
12 | Request ID: @Model.RequestId
13 |
14 | }
15 |
16 | Development Mode
17 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
26 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model ErrorViewModel
2 | @{
3 | ViewData["Title"] = "Error";
4 | }
5 |
6 | Error.
7 | An error occurred while processing your request.
8 |
9 | @if (Model.ShowRequestId)
10 | {
11 |
12 | Request ID: @Model.RequestId
13 |
14 | }
15 |
16 | Development Mode
17 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
26 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-FSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | //#if(NoHttps)
8 | "sslPort": 0
9 | //#else
10 | "sslPort": 44300
11 | //#endif
12 | }
13 | },
14 | "profiles": {
15 | "IIS Express": {
16 | "commandName": "IISExpress",
17 | "launchBrowser": true,
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "Company.WebApplication1": {
23 | "commandName": "Project",
24 | "launchBrowser": true,
25 | //#if(NoHttps)
26 | "applicationUrl": "http://localhost:5000",
27 | //#else
28 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
29 | //#endif
30 | "environmentVariables": {
31 | "ASPNETCORE_ENVIRONMENT": "Development"
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/templates.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $id$
5 | $version$
6 | $author$
7 | $description$
8 | $iconUrl$
9 | en-US
10 | true
11 | $projectUrl$
12 | $licenseUrl$
13 | $copyright$
14 | $tags$
15 |
16 |
17 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | //#if(NoHttps)
8 | "sslPort": 0
9 | //#else
10 | "sslPort": 44300
11 | //#endif
12 | }
13 | },
14 | "profiles": {
15 | "IIS Express": {
16 | "commandName": "IISExpress",
17 | "launchBrowser": true,
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "Company.WebApplication1": {
23 | "commandName": "Project",
24 | "launchBrowser": true,
25 | //#if(NoHttps)
26 | "applicationUrl": "http://localhost:5000",
27 | //#else
28 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
29 | //#endif
30 | "environmentVariables": {
31 | "ASPNETCORE_ENVIRONMENT": "Development"
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | //#if(NoHttps)
8 | "sslPort": 0
9 | //#else
10 | "sslPort": 44300
11 | //#endif
12 | }
13 | },
14 | "profiles": {
15 | "IIS Express": {
16 | "commandName": "IISExpress",
17 | "launchBrowser": true,
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "Company.WebApplication1": {
23 | "commandName": "Project",
24 | "launchBrowser": true,
25 | //#if(NoHttps)
26 | "applicationUrl": "http://localhost:5000",
27 | //#else
28 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
29 | //#endif
30 | "environmentVariables": {
31 | "ASPNETCORE_ENVIRONMENT": "Development"
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | //#if(NoHttps)
8 | "sslPort": 0
9 | //#else
10 | "sslPort": 44300
11 | //#endif
12 | }
13 | },
14 | "profiles": {
15 | "IIS Express": {
16 | "commandName": "IISExpress",
17 | "launchBrowser": true,
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "Company.WebApplication1": {
23 | "commandName": "Project",
24 | "launchBrowser": true,
25 | //#if(NoHttps)
26 | "applicationUrl": "http://localhost:5000",
27 | //#else
28 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
29 | //#endif
30 | "environmentVariables": {
31 | "ASPNETCORE_ENVIRONMENT": "Development"
32 | }
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/test/Templates.Test/Infrastructure/BrowserTestBase.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) .NET Foundation. All rights reserved.
2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3 |
4 | using System.Threading;
5 | using OpenQA.Selenium;
6 | using Xunit;
7 | using Xunit.Abstractions;
8 |
9 | namespace Templates.Test.Infrastructure
10 | {
11 | [CaptureSeleniumLogs]
12 | public class BrowserTestBase : TemplateTestBase, IClassFixture
13 | {
14 | private static readonly AsyncLocal _browser = new AsyncLocal();
15 | private static readonly AsyncLocal _logs = new AsyncLocal();
16 |
17 | public static IWebDriver Browser => _browser.Value;
18 |
19 | public static ILogs Logs => _logs.Value;
20 |
21 | public BrowserTestBase(BrowserFixture browserFixture, ITestOutputHelper output) : base(output)
22 | {
23 | _browser.Value = browserFixture.Browser;
24 | _logs.Value = browserFixture.Logs;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.doc diff=astextplain
2 | *.DOC diff=astextplain
3 | *.docx diff=astextplain
4 | *.DOCX diff=astextplain
5 | *.dot diff=astextplain
6 | *.DOT diff=astextplain
7 | *.pdf diff=astextplain
8 | *.PDF diff=astextplain
9 | *.rtf diff=astextplain
10 | *.RTF diff=astextplain
11 |
12 | *.jpg binary
13 | *.png binary
14 | *.gif binary
15 |
16 | *.cs text=auto diff=csharp
17 | *.vb text=auto
18 | *.resx text=auto
19 | *.c text=auto
20 | *.cpp text=auto
21 | *.cxx text=auto
22 | *.h text=auto
23 | *.hxx text=auto
24 | *.py text=auto
25 | *.rb text=auto
26 | *.java text=auto
27 | *.html text=auto
28 | *.htm text=auto
29 | *.css text=auto
30 | *.scss text=auto
31 | *.sass text=auto
32 | *.less text=auto
33 | *.js text=auto
34 | *.lisp text=auto
35 | *.clj text=auto
36 | *.sql text=auto
37 | *.php text=auto
38 | *.lua text=auto
39 | *.m text=auto
40 | *.asm text=auto
41 | *.erl text=auto
42 | *.fs text=auto
43 | *.fsx text=auto
44 | *.hs text=auto
45 |
46 | *.csproj text=auto
47 | *.vbproj text=auto
48 | *.fsproj text=auto
49 | *.dbproj text=auto
50 | *.sln text=auto eol=crlf
51 |
52 | *.sh eol=lf
53 |
--------------------------------------------------------------------------------
/version.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0.0
4 | alpha1
5 | $(VersionPrefix)
6 | $(VersionPrefix)-$(VersionSuffix)-final
7 | t000
8 | a-
9 | $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-'))
10 | $(VersionSuffix)-$(BuildNumber)
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_LoginPartial.Identity.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Identity
2 | @inject SignInManager SignInManager
3 | @inject UserManager UserManager
4 |
5 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "Angular",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1100"
7 | },
8 | "description": {
9 | "text": "A project template for creating an ASP.NET Core application with Angular",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1101"
12 | },
13 | "order": 310,
14 | "icon": "icon.png",
15 | "learnMoreLink": "https://github.com/aspnet/JavaScriptServices",
16 | "uiFilters": [
17 | "oneaspnet"
18 | ],
19 | "supportedAuthentications": [
20 | {
21 | "auth": "None",
22 | "authenticationType": "NoAuth",
23 | "allowUnsecured": true
24 | }
25 | ],
26 | "ports": [
27 | {
28 | "name": "HttpPort",
29 | "useHttps": false
30 | },
31 | {
32 | "name": "HttpsPort",
33 | "useHttps": true
34 | }
35 | ],
36 | "excludeLaunchSettings": false,
37 | "minFullFrameworkVersion": "4.6.1",
38 | "disableHttpsSymbol": "NoHttps"
39 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "React.js",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1500"
7 | },
8 | "description": {
9 | "text": "A project template for creating an ASP.NET Core application with React.js",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1501"
12 | },
13 | "order": 315,
14 | "icon": "icon.png",
15 | "learnMoreLink": "https://github.com/aspnet/JavaScriptServices",
16 | "uiFilters": [
17 | "oneaspnet"
18 | ],
19 | "supportedAuthentications": [
20 | {
21 | "auth": "None",
22 | "authenticationType": "NoAuth",
23 | "allowUnsecured": true
24 | }
25 | ],
26 | "ports": [
27 | {
28 | "name": "HttpPort",
29 | "useHttps": false
30 | },
31 | {
32 | "name": "HttpsPort",
33 | "useHttps": true
34 | }
35 | ],
36 | "excludeLaunchSettings": false,
37 | "minFullFrameworkVersion": "4.6.1",
38 | "disableHttpsSymbol": "NoHttps"
39 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_LoginPartial.Identity.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Identity
2 | @inject SignInManager SignInManager
3 | @inject UserManager UserManager
4 |
5 |
27 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | #if (OrganizationalAuth)
7 | using Microsoft.AspNetCore.Authorization;
8 | #endif
9 | using Microsoft.AspNetCore.Mvc;
10 | using Company.WebApplication1.Models;
11 |
12 | namespace Company.WebApplication1.Controllers
13 | {
14 | #if (OrganizationalAuth)
15 | [Authorize]
16 | #endif
17 | public class HomeController : Controller
18 | {
19 | public IActionResult Index()
20 | {
21 | return View();
22 | }
23 |
24 | public IActionResult Privacy()
25 | {
26 | return View();
27 | }
28 |
29 | #if (OrganizationalAuth)
30 | [AllowAnonymous]
31 | #endif
32 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
33 | public IActionResult Error()
34 | {
35 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "React.js and Redux",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1400"
7 | },
8 | "description": {
9 | "text": "A project template for creating an ASP.NET Core application with React.js and Redux",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1401"
12 | },
13 | "order": 320,
14 | "icon": "icon.png",
15 | "learnMoreLink": "https://github.com/aspnet/JavaScriptServices",
16 | "uiFilters": [
17 | "oneaspnet"
18 | ],
19 | "supportedAuthentications": [
20 | {
21 | "auth": "None",
22 | "authenticationType": "NoAuth",
23 | "allowUnsecured": true
24 | }
25 | ],
26 | "ports": [
27 | {
28 | "name": "HttpPort",
29 | "useHttps": false
30 | },
31 | {
32 | "name": "HttpsPort",
33 | "useHttps": true
34 | }
35 | ],
36 | "excludeLaunchSettings": false,
37 | "minFullFrameworkVersion": "4.6.1",
38 | "disableHttpsSymbol": "NoHttps"
39 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
32 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "Empty",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1011"
7 | },
8 | "description": {
9 | "text": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1012"
12 | },
13 | "order": 100,
14 | "icon": "vs-2017.3/Empty.png",
15 | "learnMoreLink": "https://go.microsoft.com/fwlink/?LinkID=784883",
16 | "uiFilters": [ "oneaspnet" ],
17 | "supportedAuthentications": [
18 | {
19 | "auth": "None",
20 | "authenticationType": "NoAuth",
21 | "allowUnsecured": true
22 | }
23 | ],
24 | "supportsDocker": true,
25 | "ports": [
26 | {
27 | "name": "HttpPort",
28 | "useHttps": false
29 | },
30 | {
31 | "name": "HttpsPort",
32 | "useHttps": true
33 | }
34 | ],
35 | "minFullFrameworkVersion": "4.6.1",
36 | "disableHttpsSymbol": "NoHttps"
37 | }
38 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/.vsts-pipelines/templates/project-ci.yml:
--------------------------------------------------------------------------------
1 | # See https://github.com/aspnet/BuildTools
2 |
3 | phases:
4 | - template: .azure/templates/jobs/default-build.yml@buildtools
5 | parameters:
6 | agentOs: Windows
7 | beforeBuild:
8 | - task: NodeTool@0
9 | displayName: Use Node 8.x
10 | inputs:
11 | versionSpec: 8.x
12 |
13 | - template: .azure/templates/jobs/default-build.yml@buildtools
14 | parameters:
15 | agentOs: macOS
16 | beforeBuild:
17 | - task: NodeTool@0
18 | displayName: Use Node 8.x
19 | inputs:
20 | versionSpec: 8.x
21 | - script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
22 | displayName: install certs
23 | env:
24 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
25 | DOTNET_CLI_TELEMETRY_OPTOUT: 1
26 |
27 | - template: .azure/templates/jobs/default-build.yml@buildtools
28 | parameters:
29 | agentOs: Linux
30 | beforeBuild:
31 | - task: NodeTool@0
32 | displayName: Use Node 8.x
33 | inputs:
34 | versionSpec: 8.x
35 | - script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
36 | displayName: install certs
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Templates [Archived]
2 |
3 | **This GitHub project has been archived.** Ongoing development on this project can be found in .
4 |
5 | ## Getting Started
6 | ASP.NET Templates provide project templates which are used in .NET Core for creating ASP.NET Core applications.
7 |
8 | This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [AspNetCore](https://github.com/aspnet/AspNetCore) repo.
9 |
10 | ## Building Templates
11 | - Running build.cmd in this repo requires NPM which can be installed from https://nodejs.org/en/.
12 | - The ASP.NET localhost development certificate must also be installed and trusted or else you'll get a test error "Certificate error: Navigation blocked".
13 | - `build.cmd` (or `build /t:package` to avoid tests) will produce NuGet packages for each class of template in the artifacts directory. These can be installed via `dotnet new -i {nugetpackage path}`
14 | - You also need to get the packages these templates depend on into your package cache or else `dotnet new` restore will fail. The easiest way to get them to run is by letting the build run at least 1 test.
15 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | //#if (WindowsAuth)
4 | "windowsAuthentication": true,
5 | "anonymousAuthentication": false,
6 | //#else
7 | "windowsAuthentication": false,
8 | "anonymousAuthentication": true,
9 | //#endif
10 | "iisExpress": {
11 | "applicationUrl": "http://localhost:8080",
12 | //#if(NoHttps)
13 | "sslPort": 0
14 | //#else
15 | "sslPort": 44300
16 | //#endif
17 | }
18 | },
19 | "profiles": {
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "launchBrowser": true,
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | },
27 | "Company.WebApplication1": {
28 | "commandName": "Project",
29 | "launchBrowser": true,
30 | //#if(NoHttps)
31 | "applicationUrl": "http://localhost:5000",
32 | //#else
33 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
34 | //#endif
35 | "environmentVariables": {
36 | "ASPNETCORE_ENVIRONMENT": "Development"
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | false
6 | False
7 | False
8 | False
9 | 2008;8021
10 | aspnet;templates
11 | $(MSBuildThisFileDirectory)templates.nuspec
12 | $(MSBuildProjectDirectory)
13 |
14 |
15 |
16 |
17 | true
18 | $(MSBuildThisFileDirectory)..\artifacts\build\
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | //#if (WindowsAuth)
4 | "windowsAuthentication": true,
5 | "anonymousAuthentication": false,
6 | //#else
7 | "windowsAuthentication": false,
8 | "anonymousAuthentication": true,
9 | //#endif
10 | "iisExpress": {
11 | "applicationUrl": "http://localhost:8080",
12 | //#if(NoHttps)
13 | "sslPort": 0
14 | //#else
15 | "sslPort": 44300
16 | //#endif
17 | }
18 | },
19 | "profiles": {
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "launchBrowser": true,
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | },
27 | "Company.WebApplication1": {
28 | "commandName": "Project",
29 | "launchBrowser": true,
30 | //#if(NoHttps)
31 | "applicationUrl": "http://localhost:5000",
32 | //#else
33 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
34 | //#endif
35 | "environmentVariables": {
36 | "ASPNETCORE_ENVIRONMENT": "Development"
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Company.WebApplication1",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "bootstrap": "^4.1.3",
7 | "jquery": "3.3.1",
8 | "react": "^16.0.0",
9 | "react-dom": "^16.0.0",
10 | "react-router-bootstrap": "^0.24.4",
11 | "react-router-dom": "^4.2.2",
12 | "react-scripts": "^1.1.5",
13 | "reactstrap": "^6.3.0",
14 | "rimraf": "^2.6.2"
15 | },
16 | "devDependencies": {
17 | "ajv": "^6.0.0",
18 | "babel-eslint": "^7.2.3",
19 | "cross-env": "^5.2.0",
20 | "eslint": "^4.1.1",
21 | "eslint-config-react-app": "^2.1.0",
22 | "eslint-plugin-flowtype": "^2.50.3",
23 | "eslint-plugin-import": "^2.14.0",
24 | "eslint-plugin-jsx-a11y": "^5.1.1",
25 | "eslint-plugin-react": "^7.11.1"
26 | },
27 | "eslintConfig": {
28 | "extends": "react-app"
29 | },
30 | "scripts": {
31 | "start": "rimraf ./build && react-scripts start",
32 | "build": "react-scripts build",
33 | "test": "cross-env CI=true react-scripts test --env=jsdom",
34 | "eject": "react-scripts eject",
35 | "lint": "eslint ./src/"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/index.js:
--------------------------------------------------------------------------------
1 | import 'bootstrap/dist/css/bootstrap.css';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom';
4 | import { Provider } from 'react-redux';
5 | import { ConnectedRouter } from 'react-router-redux';
6 | import { createBrowserHistory } from 'history';
7 | import configureStore from './store/configureStore';
8 | import App from './App';
9 | import registerServiceWorker from './registerServiceWorker';
10 |
11 | // Create browser history to use in the Redux store
12 | const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');
13 | const history = createBrowserHistory({ basename: baseUrl });
14 |
15 | // Get the application-wide store instance, prepopulating with state from the server where available.
16 | const initialState = window.initialReduxState;
17 | const store = configureStore(history, initialState);
18 |
19 | const rootElement = document.getElementById('root');
20 |
21 | ReactDOM.render(
22 |
23 |
24 |
25 |
26 | ,
27 | rootElement);
28 |
29 | registerServiceWorker();
30 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | //#if (WindowsAuth)
4 | "windowsAuthentication": true,
5 | "anonymousAuthentication": false,
6 | //#else
7 | "windowsAuthentication": false,
8 | "anonymousAuthentication": true,
9 | //#endif
10 | "iisExpress": {
11 | "applicationUrl": "http://localhost:8080",
12 | //#if(RequiresHttps)
13 | "sslPort": 44300
14 | //#else
15 | "sslPort": 0
16 | //#endif
17 | }
18 | },
19 | "profiles": {
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "launchBrowser": true,
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | },
27 | "Company.WebApplication1": {
28 | "commandName": "Project",
29 | "launchBrowser": true,
30 | //#if(RequiresHttps)
31 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
32 | //#else
33 | "applicationUrl": "http://localhost:5000",
34 | //#endif
35 | "environmentVariables": {
36 | "ASPNETCORE_ENVIRONMENT": "Development"
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | //#if (WindowsAuth)
4 | "windowsAuthentication": true,
5 | "anonymousAuthentication": false,
6 | //#else
7 | "windowsAuthentication": false,
8 | "anonymousAuthentication": true,
9 | //#endif
10 | "iisExpress": {
11 | "applicationUrl": "http://localhost:8080",
12 | //#if(RequiresHttps)
13 | "sslPort": 44300
14 | //#else
15 | "sslPort": 0
16 | //#endif
17 | }
18 | },
19 | "profiles": {
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "launchBrowser": true,
23 | "environmentVariables": {
24 | "ASPNETCORE_ENVIRONMENT": "Development"
25 | }
26 | },
27 | "Company.WebApplication1": {
28 | "commandName": "Project",
29 | "launchBrowser": true,
30 | //#if(RequiresHttps)
31 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
32 | //#else
33 | "applicationUrl": "http://localhost:5000",
34 | //#endif
35 | "environmentVariables": {
36 | "ASPNETCORE_ENVIRONMENT": "Development"
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
12 | Use this space to summarize your privacy and cookie use policy.
Learn More .
13 |
14 | Accept
15 |
16 |
17 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/README.md:
--------------------------------------------------------------------------------
1 | # Company.WebApplication1
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.0.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28 |
--------------------------------------------------------------------------------
/src/GenerateContent.targets:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/store/configureStore.js:
--------------------------------------------------------------------------------
1 | import { applyMiddleware, combineReducers, compose, createStore } from 'redux';
2 | import thunk from 'redux-thunk';
3 | import { routerReducer, routerMiddleware } from 'react-router-redux';
4 | import * as Counter from './Counter';
5 | import * as WeatherForecasts from './WeatherForecasts';
6 |
7 | export default function configureStore (history, initialState) {
8 | const reducers = {
9 | counter: Counter.reducer,
10 | weatherForecasts: WeatherForecasts.reducer
11 | };
12 |
13 | const middleware = [
14 | thunk,
15 | routerMiddleware(history)
16 | ];
17 |
18 | // In development, use the browser's Redux dev tools extension if installed
19 | const enhancers = [];
20 | const isDevelopment = process.env.NODE_ENV === 'development';
21 | if (isDevelopment && typeof window !== 'undefined' && window.devToolsExtension) {
22 | enhancers.push(window.devToolsExtension());
23 | }
24 |
25 | const rootReducer = combineReducers({
26 | ...reducers,
27 | routing: routerReducer
28 | });
29 |
30 | return createStore(
31 | rootReducer,
32 | initialState,
33 | compose(applyMiddleware(...middleware), ...enhancers)
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Client.ItemTemplates/content/TypeScript/.template.config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/template",
3 | "author": "Microsoft",
4 | "classifications": [ "Web", "Script" ],
5 | "name": "TypeScript file",
6 | "generatorVersions": "[1.0.0.0-*)",
7 | "description": "A blank TypeScript source file",
8 | "groupIdentity": "Microsoft.DotNet.Web.ClientItems.TypeScript",
9 | "precedence": "100",
10 | "identity": "Microsoft.DotNet.Web.ClientItems.TypeScript",
11 | "shortName": "tsfile",
12 | "sourceName": "file1",
13 | "tags": {
14 | "type": "item"
15 | },
16 | "primaryOutputs": [
17 | {
18 | "path": "file1.ts"
19 | }
20 | ],
21 | "defaultName": "file1",
22 | "symbols": {
23 | "HostIdentifier": {
24 | "type": "bind",
25 | "binding": "HostIdentifier"
26 | }
27 | },
28 | "postActions": [
29 | {
30 | "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
31 | "description": "Opens file1.ts in the editor",
32 | "manualInstructions": [ ],
33 | "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
34 | "args": {
35 | "files": "0"
36 | },
37 | "continueOnError": true
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "Empty",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1011"
7 | },
8 | "description": {
9 | "text": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1012"
12 | },
13 | "order": 100,
14 | "icon": "vs-2017.3/Empty.png",
15 | "learnMoreLink": "https://go.microsoft.com/fwlink/?LinkID=784883",
16 | "uiFilters": [ "oneaspnet" ],
17 | "supportsDocker": true,
18 | "legacyTemplateIdentity": "Microsoft.NetCore.CSharp.EmptyWeb",
19 | "supportedAuthentications": [
20 | {
21 | "auth": "None",
22 | "authenticationType": "NoAuth",
23 | "allowUnsecured": true
24 | }
25 | ],
26 | "ports": [
27 | {
28 | "name": "HttpPort",
29 | "useHttps": false
30 | },
31 | {
32 | "name": "HttpsPort",
33 | "useHttps": true
34 | }
35 | ],
36 | "excludeLaunchSettings": false,
37 | "minFullFrameworkVersion": "4.6.1",
38 | "disableHttpsSymbol": "NoHttps"
39 | }
40 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Client.ItemTemplates/content/Less/.template.config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/template",
3 | "author": "Microsoft",
4 | "classifications": [ "Web", "Style" ],
5 | "name": "LESS Style Sheet",
6 | "generatorVersions": "[1.0.0.0-*)",
7 | "description": "LESS is a language that compiles into CSS",
8 | "groupIdentity": "Microsoft.DotNet.Web.ClientItems.Less",
9 | "precedence": "100",
10 | "identity": "Microsoft.DotNet.Web.ClientItems.Less",
11 | "shortName": "less",
12 | "sourceName": "styleSheet1",
13 | "tags": {
14 | "type": "item"
15 | },
16 | "primaryOutputs": [
17 | {
18 | "path": "styleSheet1.less"
19 | }
20 | ],
21 | "defaultName": "styleSheet1",
22 | "symbols": {
23 | "HostIdentifier": {
24 | "type": "bind",
25 | "binding": "HostIdentifier"
26 | }
27 | },
28 | "postActions": [
29 | {
30 | "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
31 | "description": "Opens styleSheet1.less in the editor",
32 | "manualInstructions": [ ],
33 | "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
34 | "args": {
35 | "files": "0"
36 | },
37 | "continueOnError": true
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-CSharp/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.Http;
8 | using Microsoft.Extensions.DependencyInjection;
9 |
10 | namespace Company.WebApplication1
11 | {
12 | public class Startup
13 | {
14 | // This method gets called by the runtime. Use this method to add services to the container.
15 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
16 | public void ConfigureServices(IServiceCollection services)
17 | {
18 | }
19 |
20 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
21 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
22 | {
23 | if (env.IsDevelopment())
24 | {
25 | app.UseDeveloperExceptionPage();
26 | }
27 |
28 | app.Run(async (context) =>
29 | {
30 | await context.Response.WriteAsync("Hello World!");
31 | });
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2018 Twitter, Inc.
4 | Copyright (c) 2011-2018 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2018 Twitter, Inc.
4 | Copyright (c) 2011-2018 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2018 Twitter, Inc.
4 | Copyright (c) 2011-2018 The Bootstrap Authors
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ItemTemplates/content/ViewStart/.template.config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/template",
3 | "author": "Microsoft",
4 | "classifications": [ "Web", "ASP.NET" ],
5 | "name": "MVC ViewStart",
6 | "generatorVersions": "[1.0.0.0-*)",
7 | "description": "An MVC ViewStart Page",
8 | "tags": {
9 | "language": "C#",
10 | "type": "item"
11 | },
12 | "groupIdentity": "Microsoft.AspNetCore.Mvc.ViewStart",
13 | "precedence": "100",
14 | "identity": "Microsoft.AspNetCore.Mvc.ViewStart",
15 | "shortName": "viewstart",
16 | "sourceName": "ignoreme",
17 | "primaryOutputs": [
18 | {
19 | "path": "_ViewStart.cshtml"
20 | }
21 | ],
22 | "defaultName": "_ViewStart",
23 | "symbols": {
24 | "HostIdentifier": {
25 | "type": "bind",
26 | "binding": "HostIdentifier"
27 | }
28 | },
29 | "postActions": [
30 | {
31 | "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
32 | "description": "Opens _ViewStart.cshtml in the editor",
33 | "manualInstructions": [ ],
34 | "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
35 | "args": {
36 | "files": "0"
37 | },
38 | "continueOnError": true
39 | }
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Client.ItemTemplates/content/Scss/.template.config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/template",
3 | "author": "Microsoft",
4 | "classifications": [ "Web", "Style" ],
5 | "name": "SCSS Style Sheet (SASS)",
6 | "generatorVersions": "[1.0.0.0-*)",
7 | "description": "SCSS is a language that compiles into CSS",
8 | "groupIdentity": "Microsoft.DotNet.Web.ClientItems.Scss",
9 | "precedence": "100",
10 | "identity": "Microsoft.DotNet.Web.ClientItems.Scss",
11 | "shortName": "scss",
12 | "sourceName": "styleSheet1",
13 | "tags": {
14 | "type": "item"
15 | },
16 | "primaryOutputs": [
17 | {
18 | "path": "styleSheet1.scss"
19 | }
20 | ],
21 | "defaultName": "styleSheet1",
22 | "symbols": {
23 | "HostIdentifier": {
24 | "type": "bind",
25 | "binding": "HostIdentifier"
26 | }
27 | },
28 | "postActions": [
29 | {
30 | "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
31 | "description": "Opens styleSheet1.scss in the editor",
32 | "manualInstructions": [ ],
33 | "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
34 | "args": {
35 | "files": "0"
36 | },
37 | "continueOnError": true
38 | }
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/WebApi-FSharp/.template.config/vs-2017.3.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/vs-2017.3.host",
3 | "name": {
4 | "text": "API",
5 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
6 | "id": "1013"
7 | },
8 | "description": {
9 | "text": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
10 | "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}",
11 | "id": "1014"
12 | },
13 | "order": 200,
14 | "icon": "vs-2017.3/WebAPI.png",
15 | "learnMoreLink": "https://go.microsoft.com/fwlink/?LinkID=784882",
16 | "uiFilters": [ "oneaspnet" ],
17 | "supportsDocker": true,
18 | "isApi": true,
19 | "supportedAuthentications": [
20 | {
21 | "auth": "None",
22 | "authenticationType": "NoAuth",
23 | "allowUnsecured": true
24 | }
25 | ],
26 | "ports": [
27 | {
28 | "name": "HttpPort",
29 | "useHttps": false
30 | },
31 | {
32 | "name": "HttpsPort",
33 | "useHttps": true
34 | }
35 | ],
36 | "azureReplyUrlPortName": "HttpsPort",
37 | "minFullFrameworkVersion": "4.6.1",
38 | "disableHttpsSymbol": "NoHttps"
39 | }
40 |
--------------------------------------------------------------------------------
/test/Templates.Test/Infrastructure/XUnitExtensions/XunitTestFrameworkExecutorWithAssemblyFixture.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) .NET Foundation. All rights reserved.
2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3 |
4 | using System.Collections.Generic;
5 | using System.Reflection;
6 | using Xunit.Abstractions;
7 | using Xunit.Sdk;
8 |
9 | namespace Templates.Test.Helpers.XunitExtensions
10 | {
11 | public class XunitTestFrameworkExecutorWithAssemblyFixture : XunitTestFrameworkExecutor
12 | {
13 | public XunitTestFrameworkExecutorWithAssemblyFixture(AssemblyName assemblyName, ISourceInformationProvider sourceInformationProvider, IMessageSink diagnosticMessageSink)
14 | : base(assemblyName, sourceInformationProvider, diagnosticMessageSink)
15 | {
16 | }
17 |
18 | protected override async void RunTestCases(IEnumerable testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
19 | {
20 | using (var assemblyRunner = new XunitTestAssemblyRunnerWithAssemblyFixture(TestAssembly, testCases, DiagnosticMessageSink, executionMessageSink, executionOptions))
21 | {
22 | await assemblyRunner.RunAsync();
23 | }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { FormsModule } from '@angular/forms';
4 | import { HttpClientModule } from '@angular/common/http';
5 | import { RouterModule } from '@angular/router';
6 |
7 | import { AppComponent } from './app.component';
8 | import { NavMenuComponent } from './nav-menu/nav-menu.component';
9 | import { HomeComponent } from './home/home.component';
10 | import { CounterComponent } from './counter/counter.component';
11 | import { FetchDataComponent } from './fetch-data/fetch-data.component';
12 |
13 | @NgModule({
14 | declarations: [
15 | AppComponent,
16 | NavMenuComponent,
17 | HomeComponent,
18 | CounterComponent,
19 | FetchDataComponent
20 | ],
21 | imports: [
22 | BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
23 | HttpClientModule,
24 | FormsModule,
25 | RouterModule.forRoot([
26 | { path: '', component: HomeComponent, pathMatch: 'full' },
27 | { path: 'counter', component: CounterComponent },
28 | { path: 'fetch-data', component: FetchDataComponent },
29 | ])
30 | ],
31 | providers: [],
32 | bootstrap: [AppComponent]
33 | })
34 | export class AppModule { }
35 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/WebApi-FSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | //#if (WindowsAuth)
5 | "windowsAuthentication": true,
6 | "anonymousAuthentication": false,
7 | //#else
8 | "windowsAuthentication": false,
9 | "anonymousAuthentication": true,
10 | //#endif
11 | "iisExpress": {
12 | "applicationUrl": "http://localhost:8080",
13 | //#if(NoHttps)
14 | "sslPort": 0
15 | //#else
16 | "sslPort": 44300
17 | //#endif
18 | }
19 | },
20 | "profiles": {
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "launchUrl": "api/values",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | },
29 | "Company.WebApplication1": {
30 | "commandName": "Project",
31 | "launchBrowser": true,
32 | "launchUrl": "api/values",
33 | //#if(NoHttps)
34 | "applicationUrl": "http://localhost:5000",
35 | //#else
36 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
37 | //#endif
38 | "environmentVariables": {
39 | "ASPNETCORE_ENVIRONMENT": "Development"
40 | }
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/WebApi-CSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | //#if (WindowsAuth)
5 | "windowsAuthentication": true,
6 | "anonymousAuthentication": false,
7 | //#else
8 | "windowsAuthentication": false,
9 | "anonymousAuthentication": true,
10 | //#endif
11 | "iisExpress": {
12 | "applicationUrl": "http://localhost:8080",
13 | //#if(RequiresHttps)
14 | "sslPort": 44300
15 | //#else
16 | "sslPort": 0
17 | //#endif
18 | }
19 | },
20 | "profiles": {
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "launchUrl": "api/values",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | },
29 | "Company.WebApplication1": {
30 | "commandName": "Project",
31 | "launchBrowser": true,
32 | "launchUrl": "api/values",
33 | //#if(RequiresHttps)
34 | "applicationUrl": "https://localhost:5001;http://localhost:5000",
35 | //#else
36 | "applicationUrl": "http://localhost:5000",
37 | //#endif
38 | "environmentVariables": {
39 | "ASPNETCORE_ENVIRONMENT": "Development"
40 | }
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Company.WebApplication1",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "bootstrap": "^4.1.3",
7 | "jquery": "3.3.1",
8 | "react": "^16.0.0",
9 | "react-dom": "^16.0.0",
10 | "react-redux": "^5.0.6",
11 | "react-router-bootstrap": "^0.24.4",
12 | "react-router-dom": "^4.2.2",
13 | "react-router-redux": "^5.0.0-alpha.8",
14 | "react-scripts": "^1.1.5",
15 | "reactstrap": "^6.3.0",
16 | "redux": "^3.7.2",
17 | "redux-thunk": "^2.2.0",
18 | "rimraf": "^2.6.2"
19 | },
20 | "devDependencies": {
21 | "ajv": "^6.0.0",
22 | "babel-eslint": "^7.2.3",
23 | "cross-env": "^5.2.0",
24 | "eslint": "^4.1.1",
25 | "eslint-config-react-app": "^2.1.0",
26 | "eslint-plugin-flowtype": "^2.50.3",
27 | "eslint-plugin-import": "^2.14.0",
28 | "eslint-plugin-jsx-a11y": "^5.1.1",
29 | "eslint-plugin-react": "^7.11.1"
30 | },
31 | "eslintConfig": {
32 | "extends": "react-app"
33 | },
34 | "scripts": {
35 | "start": "rimraf ./build && react-scripts start",
36 | "build": "react-scripts build",
37 | "test": "cross-env CI=true react-scripts test --env=jsdom",
38 | "eject": "react-scripts eject",
39 | "lint": "eslint ./src/"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/counter/counter.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { CounterComponent } from './counter.component';
4 |
5 | describe('CounterComponent', () => {
6 | let component: CounterComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ CounterComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(CounterComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should display a title', async(() => {
23 | const titleText = fixture.nativeElement.querySelector('h1').textContent;
24 | expect(titleText).toEqual('Counter');
25 | }));
26 |
27 | it('should start with count 0, then increments by 1 when clicked', async(() => {
28 | const countElement = fixture.nativeElement.querySelector('strong');
29 | expect(countElement.textContent).toEqual('0');
30 |
31 | const incrementButton = fixture.nativeElement.querySelector('button');
32 | incrementButton.click();
33 | fixture.detectChanges();
34 | expect(countElement.textContent).toEqual('1');
35 | }));
36 | });
37 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | /* Sticky footer styles
11 | -------------------------------------------------- */
12 | html {
13 | font-size: 14px;
14 | }
15 | @media (min-width: 768px) {
16 | html {
17 | font-size: 16px;
18 | }
19 | }
20 |
21 | .border-top {
22 | border-top: 1px solid #e5e5e5;
23 | }
24 | .border-bottom {
25 | border-bottom: 1px solid #e5e5e5;
26 | }
27 |
28 | .box-shadow {
29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
30 | }
31 |
32 | button.accept-policy {
33 | font-size: 1rem;
34 | line-height: inherit;
35 | }
36 |
37 | /* Sticky footer styles
38 | -------------------------------------------------- */
39 | html {
40 | position: relative;
41 | min-height: 100%;
42 | }
43 |
44 | body {
45 | /* Margin bottom by footer height */
46 | margin-bottom: 60px;
47 | }
48 | .footer {
49 | position: absolute;
50 | bottom: 0;
51 | width: 100%;
52 | white-space: nowrap;
53 | /* Set the fixed height of the footer here */
54 | height: 60px;
55 | line-height: 60px; /* Vertically center the text there */
56 | }
57 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-FSharp/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | /* Sticky footer styles
11 | -------------------------------------------------- */
12 | html {
13 | font-size: 14px;
14 | }
15 | @media (min-width: 768px) {
16 | html {
17 | font-size: 16px;
18 | }
19 | }
20 |
21 | .border-top {
22 | border-top: 1px solid #e5e5e5;
23 | }
24 | .border-bottom {
25 | border-bottom: 1px solid #e5e5e5;
26 | }
27 |
28 | .box-shadow {
29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
30 | }
31 |
32 | button.accept-policy {
33 | font-size: 1rem;
34 | line-height: inherit;
35 | }
36 |
37 | /* Sticky footer styles
38 | -------------------------------------------------- */
39 | html {
40 | position: relative;
41 | min-height: 100%;
42 | }
43 |
44 | body {
45 | /* Margin bottom by footer height */
46 | margin-bottom: 60px;
47 | }
48 | .footer {
49 | position: absolute;
50 | bottom: 0;
51 | width: 100%;
52 | white-space: nowrap;
53 | /* Set the fixed height of the footer here */
54 | height: 60px;
55 | line-height: 60px; /* Vertically center the text there */
56 | }
57 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | for details on configuring this project to bundle and minify static web assets. */
3 |
4 | a.navbar-brand {
5 | white-space: normal;
6 | text-align: center;
7 | word-break: break-all;
8 | }
9 |
10 | /* Sticky footer styles
11 | -------------------------------------------------- */
12 | html {
13 | font-size: 14px;
14 | }
15 | @media (min-width: 768px) {
16 | html {
17 | font-size: 16px;
18 | }
19 | }
20 |
21 | .border-top {
22 | border-top: 1px solid #e5e5e5;
23 | }
24 | .border-bottom {
25 | border-bottom: 1px solid #e5e5e5;
26 | }
27 |
28 | .box-shadow {
29 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
30 | }
31 |
32 | button.accept-policy {
33 | font-size: 1rem;
34 | line-height: inherit;
35 | }
36 |
37 | /* Sticky footer styles
38 | -------------------------------------------------- */
39 | html {
40 | position: relative;
41 | min-height: 100%;
42 | }
43 |
44 | body {
45 | /* Margin bottom by footer height */
46 | margin-bottom: 60px;
47 | }
48 | .footer {
49 | position: absolute;
50 | bottom: 0;
51 | width: 100%;
52 | white-space: nowrap;
53 | /* Set the fixed height of the footer here */
54 | height: 60px;
55 | line-height: 60px; /* Vertically center the text there */
56 | }
57 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/nav-menu/nav-menu.component.html:
--------------------------------------------------------------------------------
1 |
25 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ItemTemplates/content/ViewImports/.template.config/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/template",
3 | "author": "Microsoft",
4 | "classifications": [ "Web", "ASP.NET" ],
5 | "name": "MVC ViewImports",
6 | "generatorVersions": "[1.0.0.0-*)",
7 | "description": "An MVC View Import Page",
8 | "tags": {
9 | "language": "C#",
10 | "type": "item"
11 | },
12 | "groupIdentity": "Microsoft.AspNetCore.Mvc.ViewImports",
13 | "precedence": "100",
14 | "identity": "Microsoft.AspNetCore.Mvc.ViewImports",
15 | "shortName": "viewimports",
16 | "sourceName": "ignoreme",
17 | "primaryOutputs": [
18 | {
19 | "path": "_ViewImports.cshtml"
20 | }
21 | ],
22 | "defaultName": "_ViewImports",
23 | "symbols": {
24 | "namespace": {
25 | "description": "namespace for the generated code",
26 | "replaces": "MyApp.Namespace",
27 | "type": "parameter"
28 | },
29 | "HostIdentifier": {
30 | "type": "bind",
31 | "binding": "HostIdentifier"
32 | }
33 | },
34 | "postActions": [
35 | {
36 | "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
37 | "description": "Opens _ViewImports.cshtml in the editor",
38 | "manualInstructions": [ ],
39 | "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
40 | "args": {
41 | "files": "0"
42 | },
43 | "continueOnError": true
44 | }
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/StarterWeb-CSharp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | ////#if (IndividualB2CAuth)
3 | // "AzureAdB2C": {
4 | // "Instance": "https:////login.microsoftonline.com/tfp/",
5 | // "ClientId": "11111111-1111-1111-11111111111111111",
6 | // "CallbackPath": "/signin-oidc",
7 | // "Domain": "qualified.domain.name",
8 | // "SignUpSignInPolicyId": "MySignUpSignInPolicyId",
9 | // "ResetPasswordPolicyId": "MyResetPasswordPolicyId",
10 | // "EditProfilePolicyId": "MyEditProfilePolicyId"
11 | // },
12 | ////#elseif (OrganizationalAuth)
13 | // "AzureAd": {
14 | //#if (MultiOrgAuth)
15 | // "Instance": "https:////login.microsoftonline.com/common",
16 | //#elseif (SingleOrgAuth)
17 | // "Instance": "https:////login.microsoftonline.com/",
18 | // "Domain": "qualified.domain.name",
19 | // "TenantId": "22222222-2222-2222-2222-222222222222",
20 | //#endif
21 | // "ClientId": "11111111-1111-1111-11111111111111111",
22 | // "CallbackPath": "/signin-oidc"
23 | // },
24 | //#endif
25 | ////#if (IndividualLocalAuth)
26 | // "ConnectionStrings": {
27 | ////#if (UseLocalDB)
28 | // "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true"
29 | ////#else
30 | // "DefaultConnection": "DataSource=app.db"
31 | //#endif
32 | // },
33 | //#endif
34 | "Logging": {
35 | "LogLevel": {
36 | "Default": "Warning"
37 | }
38 | },
39 | "AllowedHosts": "*"
40 | }
41 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | ////#if (IndividualB2CAuth)
3 | // "AzureAdB2C": {
4 | // "Instance": "https:////login.microsoftonline.com/tfp/",
5 | // "ClientId": "11111111-1111-1111-11111111111111111",
6 | // "CallbackPath": "/signin-oidc",
7 | // "Domain": "qualified.domain.name",
8 | // "SignUpSignInPolicyId": "MySignUpSignInPolicyId",
9 | // "ResetPasswordPolicyId": "MyResetPasswordPolicyId",
10 | // "EditProfilePolicyId": "MyEditProfilePolicyId"
11 | // },
12 | ////#elseif (OrganizationalAuth)
13 | // "AzureAd": {
14 | //#if (MultiOrgAuth)
15 | // "Instance": "https:////login.microsoftonline.com/common",
16 | //#elseif (SingleOrgAuth)
17 | // "Instance": "https:////login.microsoftonline.com/",
18 | // "Domain": "qualified.domain.name",
19 | // "TenantId": "22222222-2222-2222-2222-222222222222",
20 | //#endif
21 | // "ClientId": "11111111-1111-1111-11111111111111111",
22 | // "CallbackPath": "/signin-oidc"
23 | // },
24 | //#endif
25 | ////#if (IndividualLocalAuth)
26 | // "ConnectionStrings": {
27 | ////#if (UseLocalDB)
28 | // "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true"
29 | ////#else
30 | // "DefaultConnection": "DataSource=app.db"
31 | //#endif
32 | // },
33 | //#endif
34 | "Logging": {
35 | "LogLevel": {
36 | "Default": "Warning"
37 | }
38 | },
39 | "AllowedHosts": "*"
40 | }
41 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/store/WeatherForecasts.js:
--------------------------------------------------------------------------------
1 | const requestWeatherForecastsType = 'REQUEST_WEATHER_FORECASTS';
2 | const receiveWeatherForecastsType = 'RECEIVE_WEATHER_FORECASTS';
3 | const initialState = { forecasts: [], isLoading: false };
4 |
5 | export const actionCreators = {
6 | requestWeatherForecasts: startDateIndex => async (dispatch, getState) => {
7 | if (startDateIndex === getState().weatherForecasts.startDateIndex) {
8 | // Don't issue a duplicate request (we already have or are loading the requested data)
9 | return;
10 | }
11 |
12 | dispatch({ type: requestWeatherForecastsType, startDateIndex });
13 |
14 | const url = `api/SampleData/WeatherForecasts?startDateIndex=${startDateIndex}`;
15 | const response = await fetch(url);
16 | const forecasts = await response.json();
17 |
18 | dispatch({ type: receiveWeatherForecastsType, startDateIndex, forecasts });
19 | }
20 | };
21 |
22 | export const reducer = (state, action) => {
23 | state = state || initialState;
24 |
25 | if (action.type === requestWeatherForecastsType) {
26 | return {
27 | ...state,
28 | startDateIndex: action.startDateIndex,
29 | isLoading: true
30 | };
31 | }
32 |
33 | if (action.type === receiveWeatherForecastsType) {
34 | return {
35 | ...state,
36 | startDateIndex: action.startDateIndex,
37 | forecasts: action.forecasts,
38 | isLoading: false
39 | };
40 | }
41 |
42 | return state;
43 | };
44 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 | aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502
6 | 0
7 | 1
8 | True
9 | InProcess
10 | Company.WebApplication1
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/Controllers/SampleDataController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Mvc;
6 |
7 | namespace Company.WebApplication1.Controllers
8 | {
9 | [Route("api/[controller]")]
10 | public class SampleDataController : Controller
11 | {
12 | private static string[] Summaries = new[]
13 | {
14 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
15 | };
16 |
17 | [HttpGet("[action]")]
18 | public IEnumerable WeatherForecasts()
19 | {
20 | var rng = new Random();
21 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
22 | {
23 | DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
24 | TemperatureC = rng.Next(-20, 55),
25 | Summary = Summaries[rng.Next(Summaries.Length)]
26 | });
27 | }
28 |
29 | public class WeatherForecast
30 | {
31 | public string DateFormatted { get; set; }
32 | public int TemperatureC { get; set; }
33 | public string Summary { get; set; }
34 |
35 | public int TemperatureF
36 | {
37 | get
38 | {
39 | return 32 + (int)(TemperatureC / 0.5556);
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/Controllers/SampleDataController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Mvc;
6 |
7 | namespace Company.WebApplication1.Controllers
8 | {
9 | [Route("api/[controller]")]
10 | public class SampleDataController : Controller
11 | {
12 | private static string[] Summaries = new[]
13 | {
14 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
15 | };
16 |
17 | [HttpGet("[action]")]
18 | public IEnumerable WeatherForecasts()
19 | {
20 | var rng = new Random();
21 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
22 | {
23 | DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
24 | TemperatureC = rng.Next(-20, 55),
25 | Summary = Summaries[rng.Next(Summaries.Length)]
26 | });
27 | }
28 |
29 | public class WeatherForecast
30 | {
31 | public string DateFormatted { get; set; }
32 | public int TemperatureC { get; set; }
33 | public string Summary { get; set; }
34 |
35 | public int TemperatureF
36 | {
37 | get
38 | {
39 | return 32 + (int)(TemperatureC / 0.5556);
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/WebApi-CSharp/.template.config/dotnetcli.host.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json.schemastore.org/dotnetcli.host",
3 | "symbolInfo": {
4 | "UseLocalDB": {
5 | "longName": "use-local-db"
6 | },
7 | "AADInstance": {
8 | "longName": "aad-instance",
9 | "shortName": ""
10 | },
11 | "AAdB2CInstance": {
12 | "longName": "aad-b2c-instance",
13 | "shortName": ""
14 | },
15 | "SignUpSignInPolicyId": {
16 | "longName": "susi-policy-id",
17 | "shortName": "ssp"
18 | },
19 | "OrgReadAccess": {
20 | "longName": "org-read-access",
21 | "shortName": "r"
22 | },
23 | "ClientId": {
24 | "longName": "client-id",
25 | "shortName": ""
26 | },
27 | "Domain": {
28 | "longName": "domain",
29 | "shortName": ""
30 | },
31 | "TenantId": {
32 | "longName": "tenant-id",
33 | "shortName": ""
34 | },
35 | "Framework": {
36 | "longName": "framework"
37 | },
38 | "skipRestore": {
39 | "longName": "no-restore",
40 | "shortName": ""
41 | },
42 | "HttpPort": {
43 | "isHidden": true
44 | },
45 | "HttpsPort": {
46 | "isHidden": true
47 | },
48 | "ExcludeLaunchSettings": {
49 | "longName": "exclude-launch-settings",
50 | "shortName": ""
51 | },
52 | "UserSecretsId": {
53 | "isHidden": true
54 | },
55 | "NoHttps": {
56 | "longName": "no-https",
57 | "shortName": ""
58 | }
59 | },
60 | "usageExamples": [
61 | ""
62 | ]
63 | }
64 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/Angular-CSharp/ClientApp/src/app/home/home.component.html:
--------------------------------------------------------------------------------
1 | Hello, world!
2 | Welcome to your new single-page application, built with:
3 |
8 | To help you get started, we've also set up:
9 |
10 | Client-side navigation . For example, click Counter then Back to return here.
11 | Angular CLI integration . In development mode, there's no need to run ng serve. It runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.
12 | Efficient production builds . In production mode, development-time features are disabled, and your dotnet publish configuration automatically invokes ng build to produce minified, ahead-of-time compiled JavaScript files.
13 |
14 | The ClientApp subdirectory is a standard Angular CLI application. If you open a command prompt in that directory, you can run any ng command (e.g., ng test), or use npm to install extra packages into it.
15 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/Controllers/SampleDataController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Mvc;
6 |
7 | namespace Company.WebApplication1.Controllers
8 | {
9 | [Route("api/[controller]")]
10 | public class SampleDataController : Controller
11 | {
12 | private static string[] Summaries = new[]
13 | {
14 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
15 | };
16 |
17 | [HttpGet("[action]")]
18 | public IEnumerable WeatherForecasts(int startDateIndex)
19 | {
20 | var rng = new Random();
21 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
22 | {
23 | DateFormatted = DateTime.Now.AddDays(index + startDateIndex).ToString("d"),
24 | TemperatureC = rng.Next(-20, 55),
25 | Summary = Summaries[rng.Next(Summaries.Length)]
26 | });
27 | }
28 |
29 | public class WeatherForecast
30 | {
31 | public string DateFormatted { get; set; }
32 | public int TemperatureC { get; set; }
33 | public string Summary { get; set; }
34 |
35 | public int TemperatureF
36 | {
37 | get
38 | {
39 | return 32 + (int)(TemperatureC / 0.5556);
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/scripts/Test-Template.ps1:
--------------------------------------------------------------------------------
1 | function Test-Template($templateName, $templateArgs, $templateNupkg, $isSPA) {
2 | $tmpDir = "$PSScriptRoot/$templateName"
3 | Remove-Item -Path $tmpDir -Recurse -ErrorAction Ignore
4 |
5 | & "$PSScriptRoot/../build.cmd" /t:Package
6 | Run-DotnetNew "--install", "$PSScriptRoot/../artifacts/build/$templateNupkg"
7 |
8 | New-Item -ErrorAction Ignore -Path $tmpDir -ItemType Directory
9 | Push-Location $tmpDir
10 | try {
11 | Run-DotnetNew $templateArgs, "--no-restore"
12 |
13 | if ($templateArgs -match 'F#') {
14 | $extension = "fsproj"
15 | }
16 | else {
17 | $extension = "csproj"
18 | }
19 |
20 | $proj = "$tmpDir/$templateName.$extension"
21 | $projContent = Get-Content -Path $proj -Raw
22 | $projContent = $projContent -replace ('', "
23 |
24 |
25 |
26 | ")
27 | $projContent | Set-Content $proj
28 |
29 | dotnet publish --configuration Release
30 | dotnet bin\Release\netcoreapp2.2\publish\$templateName.dll
31 | }
32 | finally {
33 | Pop-Location
34 | Run-DotnetNew "--debug:reinit"
35 | }
36 | }
37 |
38 | function Run-DotnetNew($arguments) {
39 | $expression = "dotnet new $arguments"
40 | Invoke-Expression $expression
41 | }
42 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/WebApi-FSharp/Startup.fs:
--------------------------------------------------------------------------------
1 | namespace Company.WebApplication1
2 |
3 | open System
4 | open System.Collections.Generic
5 | open System.Linq
6 | open System.Threading.Tasks
7 | open Microsoft.AspNetCore.Builder
8 | open Microsoft.AspNetCore.Hosting
9 | #if (!NoHttps)
10 | open Microsoft.AspNetCore.HttpsPolicy;
11 | #endif
12 | open Microsoft.AspNetCore.Mvc
13 | open Microsoft.Extensions.Configuration
14 | open Microsoft.Extensions.DependencyInjection
15 |
16 | type Startup private () =
17 | new (configuration: IConfiguration) as this =
18 | Startup() then
19 | this.Configuration <- configuration
20 |
21 | // This method gets called by the runtime. Use this method to add services to the container.
22 | member this.ConfigureServices(services: IServiceCollection) =
23 | // Add framework services.
24 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2) |> ignore
25 |
26 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
27 | member this.Configure(app: IApplicationBuilder, env: IHostingEnvironment) =
28 | if (env.IsDevelopment()) then
29 | app.UseDeveloperExceptionPage() |> ignore
30 | #if (!NoHttps)
31 | else
32 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
33 | app.UseHsts() |> ignore
34 |
35 | app.UseHttpsRedirection() |> ignore
36 | #else
37 |
38 | #endif
39 | app.UseMvc() |> ignore
40 |
41 | member val Configuration : IConfiguration = null with get, set
42 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/FetchData.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | export class FetchData extends Component {
4 | static displayName = FetchData.name;
5 |
6 | constructor (props) {
7 | super(props);
8 | this.state = { forecasts: [], loading: true };
9 |
10 | fetch('api/SampleData/WeatherForecasts')
11 | .then(response => response.json())
12 | .then(data => {
13 | this.setState({ forecasts: data, loading: false });
14 | });
15 | }
16 |
17 | static renderForecastsTable (forecasts) {
18 | return (
19 |
20 |
21 |
22 | Date
23 | Temp. (C)
24 | Temp. (F)
25 | Summary
26 |
27 |
28 |
29 | {forecasts.map(forecast =>
30 |
31 | {forecast.dateFormatted}
32 | {forecast.temperatureC}
33 | {forecast.temperatureF}
34 | {forecast.summary}
35 |
36 | )}
37 |
38 |
39 | );
40 | }
41 |
42 | render () {
43 | let contents = this.state.loading
44 | ? Loading...
45 | : FetchData.renderForecastsTable(this.state.forecasts);
46 |
47 | return (
48 |
49 |
Weather forecast
50 |
This component demonstrates fetching data from the server.
51 | {contents}
52 |
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/NavMenu.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
3 | import { Link } from 'react-router-dom';
4 | import './NavMenu.css';
5 |
6 | export default class NavMenu extends React.Component {
7 | constructor (props) {
8 | super(props);
9 |
10 | this.toggle = this.toggle.bind(this);
11 | this.state = {
12 | isOpen: false
13 | };
14 | }
15 | toggle () {
16 | this.setState({
17 | isOpen: !this.state.isOpen
18 | });
19 | }
20 | render () {
21 | return (
22 |
23 |
24 |
25 | Company.WebApplication1
26 |
27 |
28 |
29 |
30 | Home
31 |
32 |
33 | Counter
34 |
35 |
36 | Fetch data
37 |
38 |
39 |
40 |
41 |
42 |
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/ClientApp/src/components/Home.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { connect } from 'react-redux';
3 |
4 | const Home = props => (
5 |
6 |
Hello, world!
7 |
Welcome to your new single-page application, built with:
8 |
13 |
To help you get started, we've also set up:
14 |
15 | Client-side navigation . For example, click Counter then Back to return here.
16 | Development server integration . In development mode, the development server from create-react-app runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.
17 | Efficient production builds . In production mode, development-time features are disabled, and your dotnet publish configuration produces minified, efficiently bundled JavaScript files.
18 |
19 |
The ClientApp subdirectory is a standard React application based on the create-react-app template. If you open a command prompt in that directory, you can run npm commands such as npm test or npm install.
20 |
21 | );
22 |
23 | export default connect()(Home);
24 |
--------------------------------------------------------------------------------
/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorPagesWeb-CSharp/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright JS Foundation and other contributors, https://js.foundation/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------