调试ASP.NET出错:


1 错误信息: 请求因 HTTP 状态 401 失败:Access Denied
  解决: 在iis信息服务器上把匿名访问和允许iis控制密码给勾上

2 以下代码段出错的提示是:
异常详细信息: System.ArgumentException: DataTable 已属于另一个 数据集 
    DataTable dtSubReqInfo = new DataTable();
   dtSubReqInfo = (DataTable)Session[this.strSubReqSessionName];
   DataSet dsSubReqInfo = new DataSet();
   dsSubReqInfo.Tables.Add(dtSubReqInfo);
改为:
   DataTable dtSubReqInfo = new DataTable();
   dtSubReqInfo = (DataTable)Session[this.strSubReqSessionName];
   DataSet dsSubReqInfo = new DataSet();
   dsSubReqInfo.Tables.Add(dtSubReqInfo.Copy());

3.分析器错误信息: 未能加载类型:(摘自:sadier
    a.解决方法
    请按照下面的步骤进行解决:
        1.看看你上次修改程序后,是不是没有编译通过?如果没有编译通过,修改错误的代码。
        2.删除原来的bin下面的dll文件(删除该程序生成的dll文件,引用的dll文件不要删除)
        3.在VS.NET中,选择“生成”->“重新生成解决方案”。 然后,重新运行,看看是否成功。
        4.如果更改了项目的根命名空间,比如叫xiaoniuge.MicroCMS,而当前项目又是在版本管理状态下,那应该用记事本打开Global.asax文件,把MicroCMS修改为xiaoniuge.MicroCMS即可。 
        5.当项目中的某个.aspx或者.ascx文件被排除在项目外,而有些页面又需要调用这个文件的时候,也会产生这样的错误,此时,你可以将该文件包括到项目中,然后重新编译一下就可以了。 
     b.解决办法:设置程序目录为虚拟目录 

4.连接ORACLE 10G出错:
    a. 无法加载 DLL (oci.dll)。
    b.Could not create an environment: OCIEnvCreate returned -1. 
    解决一:
              主要是将oracle主目录oracle\的读写权限赋予asp.net或者是IUSER_..和IWAM_..,重启计算机。
原文:
When you install your Oracle Client (whatever it might be) make sure to install the Administrator option. In 9.2.0.1.0, it was about 500 MB. This installs all the correct files you need, including oci.dll. This should be similar for most oracle client versions.

After it is done, give iuser/iwam these permissions on Oracle (for me, it was D:\Oracle\, no need to go any further):
* Read&Execute
* List Folder Contents
* Read

Restart computer. 

解决二:

打开在IIS中的WEB属性--主目录--执行权限【改为-脚本和可执行文件】;

-应用程序池【改为-MSSharePointAppPool】,刷新OK;


解决三:
文件夹权限可以不用管。

设置ORACLE_HOME变量的方法如下

控制面板>>系统>>高级>>环境变量>>系统变量>>新建系统变量

变量名写ORACLE_HOME
变量值添实际的ORACLE_HOME路径,在注册表中有

上述适用于操作系统Win2000. XP可能有些不同,但方法是一样的。


5.打开ASP.NET项目出错,提示: http:/1.1 403 forbidden 
    解决办法:重新注册IIS,aspnet_regiis -i

6.ASP.NET导出excel表格出错,错误信息: 不能访问只读文件“ExcelFilename.xls”。
导致错误的对象: Microsoft Excel
调用堆栈上的信息:    at Excel.WorkbookClass.SaveCopyAs(Object Filename)
解决办法:给虚拟目录所对应的文件加上“Everyone/写入”权限即可。

7  编译器错误信息: CS0006: 未能找到元数据文件“c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\lq_webui\39ec39c1\a6fc1b27\assembly\dl2\832ab040\002db685_5b59c201\activereports.viewer.dll”

解决方法:
      执行 aspnet_regiis -i

8 错误信息:Server Error in '/lqsh' Application.
                      --------------------------------------------------------------------------------

                      Debugging is not supported under current trust level settings.

 解决方法“Debugging is not supported under current trust level settings“ is what you will get when you have installed Windows Sharepoint Services using all the defaults and want to debug your web application or service.

To solve this you must first exclude the Virtual Directory hosting the application from WSS management by using the WSS administration tool. Then insert <trust level="Full" originUrl="" /> in your web.config.

We can also go to IIS and change the Application Pool from MSSharePointAppPool to DefaultAppPool.


错误信息:OCI-22053: overflow error
 些错误信息是由于进行除法运算时无法除尽,出现数据溢出。
解决方法 使用oracle trunc()函数截去多余的小数位。

10System.UnauthorizedAccessException: 拒绝访问。
实现将数据导到EXCEL时,要在服务器端调用微软的EXCEL组件,
   必须要求服务器端安装Excel,并且要求一定的访问权限给予WEB目录可写的权限。
解决方法
可以尝试在web.config里面添加以下一行以解决这个问题
<identity impersonate="true" userName="YourAdminUsr" password="YourAdminPwd"/>


 11 使用oleDB读取Excel时如果出现:System.Data.OleDb.OleDbException: 未指定的错误
很有可能是在web.config里多了一句:<identity impersonate="true"/>。
注意:当读取的Excel文件存放在NTFS分区里,读取时会报错“无权限访问”。可将Excel存放在fat32分区中。

 12 错误信息:System.Data.OleDb.OleDbException: Microsoft Jet 数据库引擎打不开文件''。 它已经被别的用户以独占方式打开,或没有查看数据的权限。

13 错误:您试图打开的项目是WEB项目,需要通过指定其"Url"路径来打开它
解决方法:
1.如果项目中包含文件项目名.csproj.webinfo,用记事打开它.修改
<VisualStudioUNCWeb>  
          <Web   URLPath   =  
http://localhost/项目文件夹名/项目.csproj" />  
  </VisualStudioUNCWeb>
2.如果项目中没有包含文件项目.csproj.webinfo,新建记事本,再把以下代码拷进去.
<VisualStudioUNCWeb>  
          <Web   URLPath   =  
http://localhost/项目文件夹名/项目.csproj" />  
  </VisualStudioUNCWeb>
修改后缀,为项目.csproj.webinfo即可.



posted on 2005-07-30 12:00    阅读(1553)  评论(3编辑  收藏  举报

导航