Skip to content

Fix .NET 8 Blazor CRUD Razor file generation - #3816

Open
MohamedFasulAshab wants to merge 7 commits into
dotnet:mainfrom
MohamedFasulAshab:fix/blazor-crud-net8-no-file-generation
Open

MohamedFasulAshab wants to merge 7 commits into
dotnet:mainfrom
MohamedFasulAshab:fix/blazor-crud-net8-no-file-generation

Conversation

@MohamedFasulAshab

Copy link
Copy Markdown
Contributor

Summary

Blazor CRUD scaffolding for .NET 8 completed successfully and reported that Razor files were added, but it did not create the expected CRUD pages.

The .NET 8 preprocessed template classes implemented the legacy Microsoft.DotNet.Scaffolding.Shared.T4Templating.ITextTransformation interface. The current text-templating pipeline expects Microsoft.DotNet.Scaffolding.TextTemplating.ITextTransformation.

Because these are different CLR interfaces, the template instance could not be cast to the expected type. Template execution was skipped, but the scaffolding operation still reported success.

Changes

  • Updated the .NET 8 Create, Delete, Details, Edit, and Index Blazor CRUD template classes to implement the interface expected by the current text-templating pipeline.
  • Updated TextTemplatingStep to log an actionable error and return failure when a template type does not implement the expected interface.
  • Strengthened the .NET 8 Blazor CRUD integration test to verify:
    • The generated pages directory exists.
    • All five CRUD Razor files are generated.
    • The DbContext file is generated.
    • The project builds successfully after scaffolding.

Validation

  • Built dotnet-scaffold for .NET 8.
  • Ran the .NET 8 Blazor CRUD integration test.
  • Verified generation of Create, Delete, Details, Edit, and Index Razor pages.
  • Verified DbContext generation.
  • Verified that the generated project builds successfully.
  • Verified that the changes introduce no whitespace errors.

Compatibility

  • No public API changes.
  • No changes to the generated Razor content.
  • Existing compatible templates continue to use the same execution path.
  • Incompatible template implementations now fail explicitly instead of reporting false success.

Output Screenshots

image

Fixes #3813.

@MohamedFasulAshab
MohamedFasulAshab marked this pull request as ready for review September 15, 2026 05:51
haileymck
haileymck previously approved these changes Sep 16, 2026
@haileymck

Copy link
Copy Markdown
Member

happy to reapprove after merge conflicts are resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 8 Blazor CRUD scaffolding reports success but does not generate Razor files

4 participants