ASP.NET System.Anything is not defined

2019-09-01 04:23发布

问题:

I ran Debugging and got a ton of "is not defined" errors in all the namespaces under System. The System and System.Web references are in the References folder.

Trying to back track the things I've changed since the last debug, I reduced my root namespace from the default to a three letter abbreviation. Changing it back didn't do anything. Everything else I've been working on has been individual pages.

Most (not all) of the errors go away if I add Global.System to all the namespaces or if I reduce them to the child namespace. i.e. these don't throw errors:

Global.System.Web.UI.Page

Page

But this does:

System.Web.UI.Page

Disclaimer: I'm a .NET novice.

回答1:

You tried closing and reopening Visual Studio, or doing a Full Rebuild?



回答2:

Do you have a class named "System"? Or "Global"?