DotRas.RasDialException: Exception of type 'DotRas.RasDialException' was thrown.

Jan 13, 2015 at 7:13 AM
Hi,

I'm using the ras dialer to connect to a PPTP server and for the majority of the users this works fine, but for some users the connection attempt fails and error is logged in the dial complete event:

05:16:46 RasError: -2147014835
05:16:46 DotRas.RasDialException: Exception of type 'DotRas.RasDialException' was thrown.

I was reading this thread of yours (https://dotras.codeplex.com/discussions/272401) and you seem to imply that the error might be caused by an exception being thrown in the user code, i.e. in one of the callbacks but I have try/catch blocks around all those areas of code and cannot see anywhere that would be possible.

I have also tried simulating this situation by throwing an error from within a callback and instead of causing this error I just crash the app which is not what my users are seeing.

I wonder if you could take a look at this log extract and point me in right direction?

05:16:14 OpenPort
05:16:14 PortOpened
05:16:14 ConnectDevice
05:16:15 DeviceConnected
05:16:15 AllDevicesConnected
05:16:15 Authenticate
05:16:17 AuthNotify
05:16:20 AuthNotify
05:16:24 AuthNotify
05:16:28 AuthNotify
05:16:32 AuthNotify
05:16:36 AuthNotify
05:16:40 AuthNotify
05:16:44 AuthNotify
05:16:45 VPN connection lost
05:16:45 Disconnected
05:16:46 RasError: -2147014835
05:16:46 DotRas.RasDialException: Exception of type 'DotRas.RasDialException' was thrown.
05:16:46 Failed to connect to server

Do you have any idea where this issue might be being caused?

Many thanks

Mike
Coordinator
Jan 15, 2015 at 3:46 AM
Well, yes and no.

1) The Error property on DialCompletedEventArgs is the error that occurs on the background thread is NOT from errors that occur within user code. So no matter what you do, you wouldn't be able to stop an error from populating in that location. That's errors that occur within Windows being forwarded on to your application
2) The Error event on the component is what gets raised for errors that occur within user code if you're attaching an event to one of the components.

AuthNotify usually occurs repeatedly like that when it doesn't like the credentials.