The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

bahbah2e (3) [Avatar] Offline
#1
Just wondering why loopback connections are forbidden. I would guess the answer is security related, but I can help wonder if there is in fact a business model slant to the limitation.
Psychlist1972 (177) [Avatar] Offline
#2
Re: Why No Loopback Connections?
It's both for security and to keep the app model clean.

Apps are explicitly disallowed from relying on the install of other apps on the local machine, whether those are Windows Store apps or desktop apps. Contracts are the only permitted way for one app to use another app, and that is a very loose coupling.

A loopback network call is a way around that, and is therefore disallowed.

The install experience for something which relies on, say, a WCF service on the desktop is both difficult to control, a nasty experience for the average end user, and also a potential security hole (the service could have access to things the Windows Store app didn't request permission to in the manifest).

Enterprise side-loaded apps are technically allowed to do loopback calls, as they don't *have* to have the same level of verification. We still advise against, it though.

Pete
bahbah2e (3) [Avatar] Offline
#3
Re: Why No Loopback Connections?
Side-loading is the plan for our app, so it's good to know there is a loophole. Thanks for the quick reply.
Psychlist1972 (177) [Avatar] Offline
#4
Re: Why No Loopback Connections?
Double check on the loophole by compiling to release mode with a small prototype and then running it outside Visual Studio. I haven't verified the loopback stuff since some of the earliest Windows 8 releases.

Note that you can also do a fair bit of p-invoke and other stuff when you side-load. Again, however, we suggest you avoid it if at all possible as these loopholes aren't necessarily supported scenarios. The only things we promise compatibility with is what is available to Windows Store apps and verified via WACK.

Regardless of what you do do, if it's outside the sandbox, compartmentalize the code into local service classes you can call from your viewmodel (assuming you're using MVVM). If you keep them separate like that, it will be easier for you to move to other approaches in the future.

Pete