From 33bc4576da042255f375e8ba50f4fd513dcb0e4d Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 23 Jan 2019 15:54:47 -0800 Subject: Convert ProjectTemplates to build using ProjectReferences (#6935) --- .../.template.config/dotnetcli.host.json | 13 ++++ .../.template.config/template.json | 80 +++++++++++++++++++++ .../.template.config/vs-2017.3.host.json | 16 +++++ .../vs-2017.3/RazorClassLibrary.ico | Bin 0 -> 42890 bytes .../Areas/MyFeature/Pages/Page1.cshtml | 13 ++++ .../Areas/MyFeature/Pages/Page1.cshtml.cs | 17 +++++ 6 files changed, 139 insertions(+) create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/dotnetcli.host.json create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3.host.json create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3/RazorClassLibrary.ico create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml create mode 100644 src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs (limited to 'src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp') diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/dotnetcli.host.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..709f1b9629 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/dotnetcli.host.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "Framework": { + "longName": "framework", + "isHidden": true + }, + "skipRestore": { + "longName": "no-restore", + "shortName": "" + } + } +} diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json new file mode 100644 index 0000000000..47000e198f --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Web", + "Razor", + "Library", + "Razor Class Library" + ], + "name": "Razor Class Library", + "generatorVersions": "[1.0.0.0-*)", + "description": "A project for creating a Razor class library that targets .NET Standard", + "groupIdentity": "Microsoft.Web.Razor", + "precedence": "5000", + "identity": "Microsoft.Web.Razor.Library.CSharp.3.0", + "shortName": "razorclasslib", + "tags": { + "language": "C#", + "type": "project" + }, + "sourceName": "Company.RazorClassLibrary1", + "preferNameDirectory": true, + "symbols": { + "Framework": { + "type": "parameter", + "description": "The target framework for the project.", + "datatype": "choice", + "choices": [ + { + "choice": "netcoreapp3.0", + "description": "Target netcoreapp3.0" + } + ], + "defaultValue": "netcoreapp3.0" + }, + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" + }, + "skipRestore": { + "type": "parameter", + "datatype": "bool", + "description": "If specified, skips the automatic restore of the project on create.", + "defaultValue": "false" + } + }, + "primaryOutputs": [ + { + "path": "Company.RazorClassLibrary1.csproj" + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "path": "Areas/MyFeature/Pages/Page1.cshtml" + } + ], + "defaultName": "RazorClassLibrary1", + "postActions": [ + { + "condition": "(!skipRestore)", + "description": "Restore NuGet packages required by this project.", + "manualInstructions": [ + { + "text": "Run 'dotnet restore'" + } + ], + "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", + "continueOnError": true + }, + { + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens Areas/MyFeature/Pages/Page1.cshtml in the editor", + "manualInstructions": [], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "1" + }, + "continueOnError": true + } + ] +} diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3.host.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3.host.json new file mode 100644 index 0000000000..0e58355fdc --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3.host.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json.schemastore.org/vs-2017.3.host", + "name": { + "text": "Razor Class Library", + "id": "1023", + "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}" + }, + "description": { + "text": "A project template for creating a Razor class library.", + "id": "1024", + "package": "{0CD94836-1526-4E85-87D3-FB5274C5AFC9}" + }, + "order": 305, + "icon": "vs-2017.3/RazorClassLibrary.ico", + "learnMoreLink": "https://go.microsoft.com/fwlink/?linkid=872103" +} diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3/RazorClassLibrary.ico b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3/RazorClassLibrary.ico new file mode 100644 index 0000000000..9d01cf3fd2 Binary files /dev/null and b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/vs-2017.3/RazorClassLibrary.ico differ diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml new file mode 100644 index 0000000000..b39e1ae932 --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml @@ -0,0 +1,13 @@ +@page +@model Company.RazorClassLibrary1.MyFeature.Pages.Page1Model + + + + + + + Page1 + + + + diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs new file mode 100644 index 0000000000..07a0edacfc --- /dev/null +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Company.RazorClassLibrary1.MyFeature.Pages +{ + public class Page1Model : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file -- cgit v1.2.3