Open Closed

Namespace problem in V9.0.0 module-template #8424


User avatar
0
Jurjen created
  • ABP Framework version: v9.0.0
  • UI Type: Blazor
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace: Invalid namespace
  • Steps to reproduce the issue: generate new module

When generating a module

abp add-module {ModuleName} --new --add-to-solution-file -t module-pro -u blazor -v 9.0.0

In the {ModuleName}.Blazor project, in the Pages folder, a folder {ModuleName} is generated containing a file index.razor (the sample page for the module)

Problem with this is that the namespace for this page is not specified and will be based on the folder-structure:

{ModuleName}.Blazor.Pages.{ModuleName}

This causes a kind of circular reference and causes all kinds of problems when referencing anything in the {ModuleName}.Blazor namespace

If I then create a folder within the Pages folder, for instance ControlLayout And I create a new Razor page there And I add

@using {ModuleName}.Blazor.Pages.ControlLayout

I get a red-squigly line under 'Blazor' part of the namespace and my project won't compile.

if I reference other projects starting their namespace with {ModuleName} I get similar problems

Setting the namespace for this Samplepage, adding the following line to the index.razor seems to solve the problem.

@namespace VitruviusBase.Blazor.Pages.SamplePage

I do have a sample project demonstrating this, so if it's helpful I can send it.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Thanks. Please share the test project with liming.ma@volosoft.com

    👍

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your question ticket has been refunded. Thanks.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07