UPS GetRate()运输服务器错误日志

时间:2012-08-30 13:24:52

标签: c# .net runtime-error shipping ups

有人可以帮助将此错误分解为简单的英语吗?我在服务器应用程序日志中看到以下错误,但我不确定错误发生在哪里。它引用的库是.NET Shipping库http://dotnetshipping.codeplex.com/releases/view/5241

Event Type: Error

Event Source:   .NET Runtime

Description:
Application: w3wp.exe Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: 
System.Net.WebException
Stack:
at System.Net.HttpWebRequest.GetResponse() 
at dotNETShipping.ShippingProviders.UPSProvider.GetRates()
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

2 个答案:

答案 0 :(得分:1)

The process was terminated due to an unhandled exception.表示您触发了try / catch语句未捕获的错误。从事件中,它是在HttpWebRequest对象上发生的事情。

尝试在try / catch中包装语句,特别是捕获WebExeception。

try
{
    ...
} 
catch (WebException wex)
{
    //add logging statements here. 
}
catch(Exception ex)
{
   //add more logging here 
}

我建议您最初转发有关Web异常的所有内容,然后根据返回的信息更正问题并将日志记录减少到适当的部署级别。

答案 1 :(得分:0)

您是否在使用.Net Shipping Library?上面的异常堆栈跟踪显示了dotNETShipping.ShippingProviders.UPSProvider.GetRates()方法中发生的异常。如果您只是将库用作第三方库,则需要向库的维护者执行错误报告。