RasCustomDial:

Aug 12, 2009 at 12:42 PM

Hello,

I'm trying make a solution that to call a dial up connection configurated with CMAK. Using DotRas I have managed to find the connection but I cannot make a dial up with de configuration that is guarded in a configuration file with extension .cms

Someone knows the solution to use custom connections with DotRas

Thanks

Coordinator
Aug 12, 2009 at 2:56 PM

Well, I haven't ever had anyone ask this question before but as far as DotRas is concerned you simply set the CustomDialDll property of the RasEntry object to the path of your DLL containing the RasCustomDial exported function. It looks like you're supposed to use the RasDialer like you normally would, however if your function calls RasDial the RasDialer.Options = RasDialExtensionsOptions.CustomDial flag must be set.

RasDialer dialer = new RasDialer();
dialer.EntryName = "{Your Entry Name}";
dialer.Options |= RasDialExtensionsOptions.CustomDial;

// You should still be able to use the Dial or DialAsync methods depending on what your needs are.
dialer.Dial();

If your custom dial DLL does not export the RasCustomDial function you should see an error code of 755 in the DialCompleted event if you're using the DialAsync method or in the exception that is thrown if you're using the Dial method.

Aug 26, 2009 at 12:49 PM

Hello Jeff,

I'm trying  to make a CustomDialDll but the problem is that when I assing this dll to CustomDialDll property the conection doesn't work.

The question is: That has to have a dll to be assigned to this property? Do you know any place with documentation to make a dll that allows to be assigned to this property.

Thanks

Coordinator
Aug 26, 2009 at 2:38 PM

I would probably try dialing through Windows to test the DLL you made rather than using DotRas to test it. I haven't heard anyone else trying to use this before, so I don't know if it's going to work. If you can let me know your results if something doesn't work I'd appreciate it.

Aug 27, 2009 at 7:01 AM

Like in all the places, my chief wants this for yesterday as what I have an alternative solution for when the connection is made.
I am looked for the solution to the CustomDialDll to see like it is necessary to implement it. If I manage to extract it I send you the solution. I believe that if I solved it I will solve those of the Scripts also Thanks

May 20, 2013 at 7:19 PM
Did this get resolved? I'm having a similar issue. I can use dotras to connect to a VPN connection that i created manually. However, if i create the same connection with CMAK it fails.
Coordinator
May 21, 2013 at 12:51 PM
I wasn't aware it was an issue, 99% of connection related problems are due to misconfiguration of the connection and not a problem with DotRas itself. There haven't been many problems with the dialer, but I'm not ruling it out either. I never heard back from this individual, so I assumed they got it working.

If you think you've found a problem with DotRas itself, I wouldn't have a problem taking a look into it, but I'd be looking at how you're creating connection first before saying DotRas is the problem. Need to keep in mind, that component hasn't changed much in 5+ years, and with about 20k developer downloads and only you saying there's a problem with it the odds aren't in your favor.

Jeff
May 21, 2013 at 3:51 PM
I created the CMAK package and successfully deployed it on a number of machines. I can use network connections through windows and connect to the VPN without issue. However, with dotras I get a generic error.

If i create the same connection (same settings) except that I create it manually it works both through the windows connections as well as through the dotras app.

I am using protected EAP encryption with certificates.

When I create the connection manually I can always see all the properties. When I create the connection with CMAK and I right click on the connection in windows and select properties I can not see any of the security settings. I believe they are all stored in a .cms file.

I'm certainly not saying dotras is the problem. You're right, the numbers tell the story. My guess is it is something odd with the way we are implementing VPN or creating the CMAK package. I came across this thread on a search and thought maybe there was a known issue with CMAK and dotras.

I appreciate your help.
Coordinator
May 22, 2013 at 3:11 AM
1) What error is DotRas giving you? Stack trace would be helpful.
2) Can you confirm what kind of file is storing the connection information? Windows using RAS stores the files in .PBK (phone book) files, which since DotRas uses Windows RAS, it uses those files as well.

I do recall a problem some time ago regarding DotRas and EAP when used with certificates, which since I couldn't replicate it and lost contact with the original person that reported the issue, I had no way of reproducing the problem to where I could fix it. If this is the case, you might need to grab the code and dig through it to find the problem.

AccessViolationException when dialing RAS connection

Jeff
May 22, 2013 at 4:07 AM
I will get you what I can in the morning.
Keep in mind, dotras works well with my EAP cert connection when I create it manually. Only when I install the connection using a CMAK package does dotras fail.
From: jeff_winn
Sent: ‎Tuesday‎, ‎May‎ ‎21‎, ‎2013 ‎10‎:‎11‎ ‎PM
To: [email removed]

From: jeff_winn

1) What error is DotRas giving you? Stack trace would be helpful.
2) Can you confirm what kind of file is storing the connection information? Windows using RAS stores the files in .PBK (phone book) files, which since DotRas uses Windows RAS, it uses those files as well.

I do recall a problem some time ago regarding DotRas and EAP when used with certificates, which since I couldn't replicate it and lost contact with the original person that reported the issue, I had no way of reproducing the problem to where I could fix it. If this is the case, you might need to grab the code and dig through it to find the problem.

AccessViolationException when dialing RAS connection

Jeff
Aug 13, 2013 at 7:06 PM
http://forum.devolutions.net/topic162-cmak-vpn.aspx

Just in case someone comes across this in the future. (odds are not good)

I used the discussion from devolutions.net to sort this out. I just edited the .pbk and changed Type=2 and removed the customrasdialdll and it started working.
Coordinator
Nov 6, 2013 at 12:55 AM
ckalen,

Thank you for responding with a fix. To prevent the information from being lost if that page ever goes down I'm going to replicate the answer here in DotRas terms.

1) Open the phonebook containing the CMAK connection.
2) Find your entry within the phonebook.
3) Modify the entry type from Internet to Vpn.
4) Set the CustomDialDll to an empty string.
5) Save the entry.
using DotRas;

using (RasPhoneBook pbk = new RasPhoneBook())
{
    pbk.Open(@"C:\YourPhoneBook.pbk");

    var entry = pbk.Entries["CMAKVPN"];
    entry.EntryType = RasEntryType.Vpn;
    entry.CustomDialDll = "";
    entry.Update();
}
Marked as answer by jeff_winn on 11/5/2013 at 4:55 PM