You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to edit the scaffolding template for Blazor CRUD pages, but my changes to the template are not being reflected in the output.
I tried researching this issue, and the closest answers I could find are how to edit Razor templates, or MVC component templates. I tried following these instructions, adapting to my project (I copied the Blazor folder (C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor) instead of Razor into a folder in my project called Templates, hierarchy shown here: )
and then I changed the header of the Create.tt file (to MudBlazor's header text) to test if it would work:
<PageTitle>Create</PageTitle>
<!-- Test override -->
<MudText Typo="Typo.h3" GutterBottom="true">Create was changed</MudText>
<!-- Test override -->
<h4><#= modelName #></h4>
<hr />
but I noticed upon saving, a file named Create.cs would be created in the same folder:
with the only contents being
ErrorGeneratingOutput
and attempting to scaffold would give an error. I tried deleting the Create.cs file, and starting again, but it seemed like it used the default template instead of my override. I then changed the template inside the installation directory(C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor), and tried scaffolding again, but again, no changes were shown in the output. What am I doing wrong?
Not sure if this is at all relevant, but Visual studio is spitting out these errors since I copied the template into my project:
The text was updated successfully, but these errors were encountered:
I want to edit the scaffolding template for Blazor CRUD pages, but my changes to the template are not being reflected in the output.
I tried researching this issue, and the closest answers I could find are how to edit Razor templates, or MVC component templates. I tried following these instructions, adapting to my project (I copied the Blazor folder (C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor) instead of Razor into a folder in my project called Templates, hierarchy shown here: )
and then I changed the header of the Create.tt file (to MudBlazor's header text) to test if it would work:
<PageTitle>Create</PageTitle>
<!-- Test override -->
<MudText Typo="Typo.h3" GutterBottom="true">Create was changed</MudText>
<!-- Test override -->
<h4><#= modelName #></h4>
<hr />
but I noticed upon saving, a file named Create.cs would be created in the same folder:
with the only contents being
ErrorGeneratingOutput
and attempting to scaffold would give an error. I tried deleting the Create.cs file, and starting again, but it seemed like it used the default template instead of my override. I then changed the template inside the installation directory(C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor), and tried scaffolding again, but again, no changes were shown in the output. What am I doing wrong?
Not sure if this is at all relevant, but Visual studio is spitting out these errors since I copied the template into my project:
I want to edit the scaffolding template for Blazor CRUD pages, but my changes to the template are not being reflected in the output.
I tried researching this issue, and the closest answers I could find are how to edit Razor templates, or MVC component templates. I tried following these instructions, adapting to my project (I copied the Blazor folder (C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor) instead of Razor into a folder in my project called Templates, hierarchy shown here: )
and then I changed the header of the Create.tt file (to MudBlazor's header text) to test if it would work:
but I noticed upon saving, a file named Create.cs would be created in the same folder:
with the only contents being
ErrorGeneratingOutput
and attempting to scaffold would give an error. I tried deleting the Create.cs file, and starting again, but it seemed like it used the default template instead of my override. I then changed the template inside the installation directory(C:\Users\username.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\8.0.2\Templates\Blazor), and tried scaffolding again, but again, no changes were shown in the output. What am I doing wrong?
Not sure if this is at all relevant, but Visual studio is spitting out these errors since I copied the template into my project:
The text was updated successfully, but these errors were encountered: