“XXXXXX is a” namespace “, but here it is used as a” type “

Recently, I encountered this problem several times when learning C #. When writing ArrayList and StringBuilder, the main function will report the error that “XXXXXX is a” namespace “, but it is used as a” type “here. After several times of searching for information, we finally know where the mistake is.

For the convenience of the diagram, you can name the project name directly as the class name. That’s the mistake. The priority of the namespace is higher than the class name. Just change the project name when you create a new project.

In short, avoid duplicate class and project names.

Read More: