以下代码捕获EOS异常
using (var reader = new BinaryReader(httpRequestBodyStream)) {
try {
while (true) {
bodyByteList.Add(reader.ReadByte());
}
} catch (EndOfStreamException) { }
}
Run Code Online (Sandbox Code Playgroud)
那么为什么我的控制台仍然会收到第一次机会异常?
mscorlib.dll中发生了'System.IO.EndOfStreamException'类型的第一次机会异常
有没有办法隐藏这些第一次机会异常消息?
我正在研究asp.net应用程序..当我尝试编译并运行应用程序时; 它运行成功.
但是当我尝试调试应用程序时,它在任何时候都给我错误 -
mscorlib.dll中出现'System.Threading.ThreadAbortException'类型的第一次机会异常
它没有在任何特定代码行给出错误..它在任何代码行(不确定)给出此错误..然后网页显示 - "服务器应用程序不可用"错误.
即使我试图在即时窗口/快速监视中解析/执行某些语句 - 它给我上面的错误..
例如,我在XElement中加载了一个xml文档(超过10000行),当我尝试通过xpath检查某些属性值为XElementObj.XPathSelectElement("/ asdf/asd/wqer/xyz")时..它给出了上面的错误..(不是所有的时间,而是随机).
任何人对此有任何想法..请帮助.
我在内置的VS webserver上运行MVC应用程序.但是,每次浏览页面时,Visual Studio中的输出选项卡都会显示很多异常.
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code
Run Code Online (Sandbox Code Playgroud)
我已经尝试检查Debug Menu下的VS …
环境:
Windows Server 2008 R2
IIS 7.5
.NET 4.0, Integrated Application Pool
Oracle Client 11.2.0.2.0
ODP.net 11.2.0.2.3
Run Code Online (Sandbox Code Playgroud)
我有一个使用ODP.net连接到我们的Oracle数据库的网站,在"完全信任"下,该应用程序运行完美.但是,当我将应用程序更改为使用"中等信任"时,我开始从应用程序获取不一致的NullReferenceExceptions.大多数时候代码都有效,但每10个请求左右我就得到NullReferenceException.查看事件日志后,我发现NullRefernceException通常对应于w3wp.exe崩溃.
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: OraOps11w.dll, version: 2.112.2.0, time stamp: 0x4cea1904
Exception code: 0xc0000005
Fault offset: 0x0000000000024d56
Faulting process id: 0x3ba4
Faulting application start time: 0x01ccdf556d68384a
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Oracle64\product\11.2.0\client\bin\OraOps11w.dll1
Run Code Online (Sandbox Code Playgroud)
显然问题是ODP.NET,但为什么它会在"中等信任"中崩溃w3wp.exe.因此,为了确保我的代码中没有出错,我编写了最简单的ASP.NET Web应用程序:
protected void Page_Load(object sender, EventArgs e) {
using(OracleConnection conn = new OracleConnection(GetMyConnectionString())){
using (OracleCommand cmd = new OracleCommand("select localtimestamp …Run Code Online (Sandbox Code Playgroud)