microsoft / RTVS

R Tools for Visual Studio.
MIT License
388 stars 118 forks source link

Help - Initialization - Deadlock #4343

Open yuriverges opened 5 years ago

yuriverges commented 5 years ago

Hi there, how you doing?

I´m trying to use the API, but I am having some kind of Deadlock problem. When executing the simple example bellow, the program gets stuck at line 7 waiting for the completion response. Can you give any advice of how can I solve this?

Thanks

1 IRHostSession session = RHostSession.Create("Test"); 2 Task sessionStartTask = session.StartHostAsync(new RHostSessionCallback()); 3 sessionStartTask.Wait();

4 // Simple output from console 5 Console.WriteLine("Arbitrary R code:"); 6 var result = session.ExecuteAndOutputAsync("Sys.info()"); 7 result.Wait(); 8 Console.WriteLine(result.Result.Output);