Quantcast
Viewing all articles
Browse latest Browse all 3509

Visual Studio 2019 - Incorrect Namespace when adding a new page

Hi everyone

In visual studio 2019, when I try to add a new razor page (new scaffolded item) after creating a model, the namespace is not right as I want. the namespace does not contain the folders name between the project name and the individual files. the expected namespace should be "RDAccounting.Pages.Products", but the automatically generated namespace is just "RDAccounting".  Its not including the folder(s)

The file structure generated automatically as follows.

RDAccounting(the solution name)

     -Pages

            -Products

                    -Create.cshtml

                    -Delete.cshtml

                    -Details.cshtml

                    -Edit.cshtml

                    -Index.cshtml

I have to manually correct the namespace of the page everytime i add a new page to include the folder structure or else the namespace would clash.Image may be NSFW.
Clik here to view.

Im using Visual studio 2019(latest update) and .net core 2.2.  I'm not having this kind of error before but 2 days ago, i reformatted my machine and reinstalled VS2019... and now the issue is happening. 

Does anyone have a solution on this? 

Many thanks.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>