Skip to content

Commit 4b30be1

Browse files
authored
Merge pull request #64532 from dotnet/dev/drewnoakes/fix-razor-class-library-project-template
Fix post actions for Razor Class Library template
2 parents 94d8301 + 9010af5 commit 4b30be1

File tree

1 file changed

+18
-3
lines changed
  • src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config

1 file changed

+18
-3
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@
7777
"path": "Company.RazorClassLibrary1.csproj"
7878
},
7979
{
80-
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
80+
"condition": "(SupportPagesAndViews && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
8181
"path": "Areas/MyFeature/Pages/Page1.cshtml"
82+
},
83+
{
84+
"condition": "(!SupportPagesAndViews && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
85+
"path": "Component1.razor"
8286
}
8387
],
8488
"defaultName": "RazorClassLibrary",
@@ -96,15 +100,26 @@
96100
"continueOnError": true
97101
},
98102
{
99-
"id": "openInEditor",
100-
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
103+
"id": "openPageInEditor",
104+
"condition": "(SupportPagesAndViews && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
101105
"description": "Opens Areas/MyFeature/Pages/Page1.cshtml in the editor",
102106
"manualInstructions": [],
103107
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
104108
"args": {
105109
"files": "1"
106110
},
107111
"continueOnError": true
112+
},
113+
{
114+
"id": "openComponentInEditor",
115+
"condition": "(!SupportPagesAndViews && HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
116+
"description": "Opens Component1.razor in the editor",
117+
"manualInstructions": [],
118+
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
119+
"args": {
120+
"files": "1"
121+
},
122+
"continueOnError": true
108123
}
109124
]
110125
}

0 commit comments

Comments
 (0)