vb.net - Await requires that the type Task have a suitable GetAwaiter method -


i move working app framework 4.0 4.6.1 , have 1 problem. error message in subject. have second error:

sendpingasync not member of 'ping' 

the subject error appears within method below on line highlited:

await isdestinationreachable(ipaddress) 

method:

 public async sub pinguj(sender object, e eventargs)         dim isreachable boolean = await isdestinationreachable(ipaddress)         listbox2.items.add("a teraz zmiana")         if isreachable             tspingresulticon.backcolor = color.green         else             tspingresulticon.backcolor = color.red         end if     end sub 

second error appear in below method on line:

pinger.sendpingasync(hostnameoraddress) 

method:

 public async function isdestinationreachable(byval hostnameoraddress string) task(of boolean)         dim reachable boolean = false         try             if my.computer.network.isavailable                 dim pinger ping = new ping()                 dim result pingreply = await pinger.sendpingasync(hostnameoraddress)                 reachable = result.status = ipstatus.success             end if         catch pingexception system.net.networkinformation.pingexception         catch genericnetworkexception system.net.networkinformation.networkinformationexception             ' fail silently , return false         end try         return reachable     end function 


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -