kaboom
kaboom

Reputation: 833

asp.net namespace doesn't match folder structure

I am building this SportStore app from a book example. Everything works perfectly. But when I look into the code, I realize that the namespace doesn't match the folder path. Then why Visual Studio can still compile and run them example? (as you notice, the difference is the letter "s" in "SportsStore"

namespace

enter image description here

Upvotes: 0

Views: 300

Answers (1)

user47589
user47589

Reputation:

Folder and filenames are ignored by the compiler. All it cares about is the contents of the files. .Net doesn't require folders to match namespaces. Class names are not required to match the filenames, either.

Upvotes: 1

Related Questions