Reputation: 381
I've been working on a new MVC 4 project using .Net 4.5 and VS2012, and for a while it was working fine. But suddenly I'm getting lots of errors like:
'System.Web.HttpApplication' is not defined.
At first, I thought it was an assembly reference problem, but that all seems fine. Upon further research, at appears that the Global namespace is being required any time a namespace is specified. Either of these two forms work just fine:
Public Class MvcApplication
Inherits Global.System.Web.HttpApplication
End Class
Public Class MvcApplication
Inherits HttpApplication
End Class
However, this form will not work for any class:
Public Class MvcApplication
Inherits System.Web.HttpApplication
End Class
Does anybody have any ideas? Thanks in advance.
Upvotes: 1
Views: 300
Reputation: 381
Well, I figured it out. I had another assembly that had System as the second part of the assembly name, and the first part was imported into the assembly I was working on. So anytime I tried to reference System. anything, it was looking in the System namespace of the other assembly instead of the global System namespace.
Upvotes: 1