我无法发现错误(targetinvocationexception
未处理)
我有一个webservice客户端类:
Partial Public Class NfeAutorizacao
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
等。
我将webservice称为异步:
Public Overloads Sub nfeAutorizacaoLoteAsync(ByVal nfeDadosMsg As
System.Xml.XmlNode, ByVal userState As Object)
If (Me.nfeAutorizacaoLoteOperationCompleted Is Nothing) Then
Me.nfeAutorizacaoLoteOperationCompleted =
AddressOf Me.OnnfeAutorizacaoLoteOperationCompleted
End If
Me.InvokeAsync("nfeAutorizacaoLote", New Object() {nfeDadosMsg},
Me.nfeAutorizacaoLoteOperationCompleted, userState)
End Sub
如果没有互联网,则会抛出一个我无法捕获的异常。所以我的应用程序崩溃了。
我做错了什么;有没有办法捕捉错误?