1
Vote

DotRAS phone book add entry BUG

description

I am working with DotRas version 1.3.5166 (the latest version from codeplex) and it seems that I have found a severe bug =((

I am trying to add a new entries in the rasphone.pbk
that I had created
if (File.Exists(".\\rasphone.pbk"))
            {
                File.SetAttributes(".\\rasphone.pbk", FileAttributes.Normal);
                File.Delete(".\\rasphone.pbk");
            }
            using (File.Create(".\\rasphone.pbk")) ; // void 
            this.phonebook.Open(".\\rasphone.pbk");
And now I will start to setup this new phone book:
foreach (Tuple<string, string> serv in servers)
            {
               // Item1 = connectionName 
               // Item2 = IP
                createEntryInPhonebook(serv.Item1, serv.Item2); // BreakPoint1 in this function
             }                                                  //BreakPoint 2
and
 public void createEntryInPhonebook(string connectionName, string serverAddress)
        {
            if (this.phonebook.Entries.Contains(connectionName))
                return ;
            RasDevice device = RasDevice.GetDevices().Where(o => o.DeviceType == RasDeviceType.Vpn).First();
            RasEntry entry = RasEntry.CreateVpnEntry(connectionName, serverAddress, RasVpnStrategy.Default, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn), false);
            this.phonebook.Entries.Add(entry);
        } //// BreakPoint 1
At first step at Break Point1 I have
this.phonebook.Entries.Count = 1
BUT, at the same first step of my foreach loop I have at BreakPoint 2
this.phonebook.Entries.Count = 2; // !!!!!!
the enties are similar !!! they have the same connection name, IP address AND even
this.phonebook.Entries[0].Id == this.phonebook.Entries[1].Id
after this the programm is crashing if I try to add or remove any item/ I have found the same issue in codeplex provided sample =(

comments