简体   繁体   中英

WP8 emulator cant connect to IIS Express

I'm unable to get a connection from WP8 emulator to an IIS Express local instance. I've set the binding an am running VS with admin rights:

<bindings>
     <binding protocol="http" bindingInformation="*:5285:localhost" />
     <binding protocol="http" bindingInformation="*:5285:192.168.1.90" />
</bindings>

The binding is working since it shows up in the IIS Express menu and I can view results when sending a GET in Fiddler to [code]http://192.168.1.90:5285/api/account/getallusers[/code].

I've created a test method in WP8 to try to access the api:

public async static void TestConnection()
{
    var url = "http://192.168.1.90:5285/api/account/getusers";
    using (var client = new HttpClient())
    {
        var res = await client.GetAsync(url);
        Debug.WriteLine(res.StatusCode);
    }
}

This should be enough to get the WP8 emulator to connect to the IIS instance but im getting Not Found all the time. Does anyone have any suggestions about what might be causing this?

The step that I usually forget is to open the firewall port for the IIS express.

Make sure you open the port 5285 in the firewall.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM