Accessing a WCF service in a Windows Store App hangs -
i've started work on windows 8 store app needs communicate wcf service running windows service on windows 7 server. binding net.tcp, no security (yet). i've gone package.appxmanifest file , checked "internet (client)" , "private networks (client , server)" in both main application project , in unit test project. works fine in unit test project, can communicate wcf service running on windows 7 machine, i'm unable access service in windows 8 app itself. application hangs on call webservice proxy. missing simple permissions / manifest capabilities ?
edit: i've got working. service interface returned task<ilist<mydataobj>>
, implementation asynchronous (used async
keyword on method implementation). when ran in unit test, call getitems()
, wait()
on returned task. copying app, wouldn't work. when changed code in app around , await
ed task call instead, call made wcf service. question @ point is, what's difference between 2 environments , cause call hang ?
i explain deadlock situation on blog , in msdn article.
the short summary await
(by default) capture current context , resume async
method within context.
in ui apps, context ui context, if blocking thread call wait
, async
method can't re-enter ui context complete.
in (most) unit testing frameworks, context thread pool context, wait
blocks 1 thread pool thread , async
method can continue on one.
Comments
Post a Comment