It’s just a warning and asking the user to have the namespace matching with the same folder name. This warning can be ignored. It’s recommended to use the namespace matching with the folder hierarchy so that it becomes easy the get the location of file in the folder structure. And when user creates new file inside any folder using VS template, it creates the file with the folder structure namespace by default. It’s recommended but optional.
In your case there is no folder named as StockPortal in the StockPortal project and if the file is located in StockPortal folder and if you’re using the namespace StockPortal.StockPortalthen warning will go away.
Buy Program.cs is generally under root folder of source code.
2
Answers
It’s just a warning and asking the user to have the namespace matching with the same folder name. This warning can be ignored. It’s recommended to use the namespace matching with the folder hierarchy so that it becomes easy the get the location of file in the folder structure. And when user creates new file inside any folder using VS template, it creates the file with the folder structure namespace by default. It’s recommended but optional.
In your case there is no folder named as
StockPortal
in the StockPortal project and if the file is located inStockPortal
folder and if you’re using the namespaceStockPortal.StockPortal
then warning will go away.Buy Program.cs is generally under root folder of source code.
I have had this problem too for a while. I have .NET SDK 5.0.404 installed with VS 2019, 16.11.8, latest.
It is mentioned here:
and here:
The issue (first one) is closed but people still experience problems.
Until it is fixed I solve it by adding the following to the project-file:
Hope that helps until it is fixed.