日期:2014-05-18  浏览次数:20457 次

本机try catch可以抓到异常,但release后trycatch不起作用了
string   mystring   =   "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source=d:\test.xls;Extended   Properties=\ "Excel   8.0\ " ";
OleDbConnection   cnnxls   =   new   OleDbConnection(my_xlsstring);
try
{
cnnxls.Open();
}
catch   (System.Data.OleDb.OleDbException   eole)
{
Response.Write( "alert ");
  }

------解决方案--------------------
Response.Write( "alert ");

和release沒關係
------解决方案--------------------
哈 那就是没有异常呗
------解决方案--------------------
呵,难道楼主希望经常会catch到异常吗?
据我所知,不会有所说的发布后,无法catch到异常这种情况。
没有捕获到异常,说明你的代码没有问题,或是在特定的状态下没有异常。