This is a mirror of official site: http://jasper-net.blogspot.com/

Allowing a WinRT app to do loopback network calls

| Tuesday, March 20, 2012
One issue I’ve encountered while building Metro-style WinRT apps on Windows 8 is the need to have my app interact with a WCF service running on the same machine.

This is obviously a common scenario for any n-tier or SOA app development. The challenge we face is that WinRT apps are blocked from calling back to localhost (127.0.0.1). The challenge and solution are described here:

To find the real application name (moniker) necessary, I wrote a simple command line utility to read the registry:

using System; 
using Microsoft.Win32;

namespace WinRtAppList 
  class Program 
  { 
    static void Main(string[] args) 
    { 
      var reg = Registry. 
        CurrentUser.OpenSubKey("Software"). 
        OpenSubKey("Classes"). 
        OpenSubKey("Local Settings"). 
        OpenSubKey("Software"). 
        OpenSubKey("Microsoft"). 
        OpenSubKey("Windows"). 
        OpenSubKey("CurrentVersion"). 
        OpenSubKey("AppContainer"). 
        OpenSubKey("Mappings");

      var items = reg.GetSubKeyNames(); 
      string query = null; 
      if (args.Length > 0) 
        query = args[0].ToLower();

      foreach (var item in items) 
      { 
        var app = reg.OpenSubKey(item); 
        var displayName = app.GetValue("DisplayName").ToString(); 

Read more: ROCKFORD LHOTKA
QR: Inline image 1

Posted via email from Jasper-net

0 comments: