radzenhq / radzen-blazor-studio

Sample applications created with Radzen Blazor Studio
https://www.radzen.com/blazor-studio
18 stars 3 forks source link

Pages in added folder are scaffolded in wrong namespace #112

Closed PavelVsl closed 1 year ago

PavelVsl commented 1 year ago

Issue Description

I encountered an issue where pages added in a specific folder were scaffolded with the wrong namespace in Radzen Blazor Studio. This caused the studio to display error messages and prevented the rendering of all pages. Application itself can be build and run without problems.

Steps to Reproduce

  1. Create a new folder within the Pages directory.
  2. Right-click on the newly created folder.
  3. Select "Add Page" from the context menu.
  4. Scaffold multiple pages within the folder.
  5. Observe that the *.razor.cs files generated for the scaffolded pages have incorrect namespaces.
  6. As a result, Radzen Blazor Studio raises error complaints and stops rendering all pages.

Expected Behavior

The scaffolded pages should have the correct namespaces and be rendered without any errors.

Actual Behavior

The pages are scaffolded with incorrect namespaces, causing Radzen Blazor Studio to display error messages and fail to render any pages.

Error Message

The following error is reported by the analyzer for each .razor page, it looks than .razor code cannot find his partial counterpart:

/Pages/AddApplicationRole.razor.cs(41,39): error CS0115: 'AddApplicationRole.OnInitializedAsync()': no suitable method found to override

Workaround

The issue can be resolved by manually fixing the namespaces for the affected files. After correcting the namespaces, Radzen Blazor Studio should function correctly without any further problems.

PavelVsl commented 1 year ago

It's fixed now, thank you.