ASP.Net 2.0 VB网站项目"类型'异常'没有定义" [英] ASP.Net 2.0 VB WebSite Project "Type 'Exception' is not defined"

查看:111
本文介绍了ASP.Net 2.0 VB网站项目"类型'异常'没有定义"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然间我们的VB ASP.Net 2.0网站项目的开始抱怨没有定义的异常。

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

我发现,如果我添加导入系统的标题,或明确使用的System.Exception,它的作品,但这个错误贯穿了很多像Data命名空间,DateTime对象的其他系统的后代。我们有成百上千的网页,因此增加进口系统对所有这些不仅会耗费时间,但它似乎像一个创可贴修复的问题。

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.

我已经检查了项目 - >属性Pages->引用,web.config文件和组件导入到项目,它只是没有被自动进口到类文件,比如它通常是。请注意,这不仅影响codeBehind,但所有className.vb文件。

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.

更多:位于Windows \\ Microsoft.Net ... \\ CONFIG \\ Web.Config文件确实有Web.config文件中,并添加系统。添加标签,添加系统到本地web.config中什么也没做,以缓解这个问题。

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.

任何帮助将是AP preciated。先这样的问题,所以我希望我足够的描述。

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

推荐答案

修改Web.config文件,并添加℃在你想要的名称空间;在标签;网页&GT <&的System.Web GT;

Alter the Web.config file and add the namespaces you want under the <pages> tag in <system.web>:

<pages>
	<namespaces>
		<add namespace="System"/>
		<add namespace="System.Data"/>
		<add namespace="System.Web"/>
		<add namespace="System.Web.UI"/>
		<add namespace="System.Xml"/>
		<add namespace="System.Data.SqlClient"/>
		<add namespace="System.Collections.Generic"/>
	</namespaces>
</pages>

这篇关于ASP.Net 2.0 VB网站项目&QUOT;类型'异常'没有定义&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆