Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Index.razor by default in blazorserver, blazorwasm templates #42330

Closed
TanayParikh opened this issue Jun 21, 2022 · 5 comments
Closed

Open Index.razor by default in blazorserver, blazorwasm templates #42330

TanayParikh opened this issue Jun 21, 2022 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components cost: XS Will take up to half a day to complete feature-blazor-server feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-templates task

Comments

@TanayParikh
Copy link
Contributor

Razor class library does this.

Basically you want to have the file you want to open as a conditional secondary primaryOutput for non-CLI hosts, then add a post action.

Originally posted by @phenning in #42215 (comment)

@TanayParikh TanayParikh added task area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-templates feature-blazor-server cost: XS Will take up to half a day to complete labels Jun 21, 2022
@TanayParikh
Copy link
Contributor Author

@phenning I'm not seeing where the file path is actually specified (I'm assuming the description isn't parsed for the path, is it?):

"id": "openInEditor",
"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

@phenning
Copy link
Contributor

phenning commented Jun 22, 2022

@phenning I'm not seeing where the file path is actually specified (I'm assuming the description isn't parsed for the path, is it?):

"id": "openInEditor",
"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

args.files is the zero based index into the primaryOutputs object array

"files": "1"
or
"files": "1;2" if you wanted to open multiple files.

@javiercn
Copy link
Member

Is Index.razor what we want to open vs other things like Program.cs? Could we open both?

@TanayParikh
Copy link
Contributor Author

Is Index.razor what we want to open vs other things like Program.cs? Could we open both?

Index.razor was just the first one to come to mind. Yeah we can definitely do program as well.

@phenning
Copy link
Contributor

Now that I looked at the other web templates, I noticed none of the others are opening any files. Maybe we should do the same here. I just asked the question in case the team wanted to consider for this template. We might want to err on the side of consistency though

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components cost: XS Will take up to half a day to complete feature-blazor-server feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-templates task
Projects
None yet
Development

No branches or pull requests

4 participants