ASP.Net 2.0 VB WebSite Project "Type 'Exception' is not defined"

Posted by AtlSteve on Stack Overflow See other posts from Stack Overflow or by AtlSteve
Published on 2009-01-08T14:21:59Z Indexed on 2010/05/24 2:21 UTC
Read the original article Hit count: 506

Filed under:
|
|
|

All of a sudden our VB ASP.Net 2.0 WebSite Project started complaining that Exception was not defined.

I have discovered that if I add "Imports System" to the header, or explicitly use System.Exception that it works, but this error permeates a lot of other System descendants like the Data namespace, and the DateTime object. We have hundreds and hundreds of pages, so adding Imports System to all of them not only would be time consuming, but it seems like a band-aid fix to the problem.

I have checked the Project->Property Pages->References, and the web.config file, and the assembly is imported into the project, it is just not being "Auto Imported" into the Class Files like it USUALLY is. Note this does not JUST affect CodeBehind, but All className.vb files.

I would like to fix this problem, but more importantly would like to understand what could cause the System namespace to all of a sudden stop being auto imported. There is obviously some file change that caused this, as my co-worker started seeing the problem this morning after he did a Full-Get on the project.

MORE: The Web.Config file located in the Windows\Microsoft.Net...\Config\Web.Config file does have the , and System is added. Adding the tags, and adding System to the LOCAL web.config did nothing to mitigate the problem.

Any help would be appreciated. First SO Question, so I hope I was descriptive enough.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about ASP.NET