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. https://github.com/dotnet/aspnetcore/blob/5026aefddd69322da633d4b29a3d24c4df0b51b9/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json#L99 _Originally posted by @phenning in https://github.com/dotnet/aspnetcore/pull/42215#discussion_r903146520_
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.
aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json
Line 99 in 5026aef
Originally posted by @phenning in #42215 (comment)