1

I am trying to access BlockCypher from console Application which works absolutely fine. But when i am trying to access the same MVC Web Application, I am not getting the response from "BlockCypher". not sure why. here is the link i am following:

BlockCypher git

here is the code i am using

  Blockcypher objmain = new Blockcypher("XXXXXXXXXXXXXXX", Endpoint.BcyTest);

        objmain.GenerateAddress().Wait();

please help, any idea what i am doing wrong in web.? or what i am missing.

Ram Singh
  • 6,664
  • 35
  • 100
  • 166

1 Answers1

1

You seem to be hitting a deadlock, instead of using Wait() in a synchronous context, instead make your action / parent code async and use await.

public async Task<ActionResult> MyAction()
{
    var bc = new Blockcypher("..", Endpoint.BcyTest);
    await bc.GenerateAddress();

    // ..
}
Rudi Visser
  • 21,350
  • 5
  • 71
  • 97