Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make WebHttpBehavior for ClientAccessPolicy.xml stop stealing/hijacking IIS's root?
    primarykey
    data
    text
    <p>I am using a Silverlight application that has net.tcp WCF communications. I would like to self host the ClientAccessPolicy.xml within the ServiceHost and the policy file must be on the root, port 80, as per Silverlight net.tcp requirements (TCP port 4502-4534, etc.). My problem is that when my ServiceHost is running it steals port 80 root from IIS and none of my web pages work.</p> <p>The code to create the policy endpoint looks like:</p> <pre><code>host.AddServiceEndpoint(typeof(IPolicyGetter), new WebHttpBinding(), "http://localhost/").Behaviors.Add(new WebHttpBehavior()); </code></pre> <p>When the ServiceHost is running then I can see my <code>http://127.0.0.1/ClientAccessPolicy.xml</code>, but all web sites on port 80 stop working - I see the standard WCF "Endpoint not found" web page generated by the Endpoint. When I turn off the ServiceHost then I can see my web site but the ClientAccessPolicy.xml is gone.</p> <p>I have tried using a complete path for the endpoint URI:</p> <pre><code>policyUri.Scheme = "http"; policyUri.Port = 80; policyUri.Query = "ClientAccessPolicy.xml"; host.AddServiceEndpoint(typeof(IPolicyGetter), new WebHttpBinding(), policyUri.ToString()).Behaviors.Add(new WebHttpBehavior()); </code></pre> <p>but this throws an argument exception. Moving the policy to a subdirectory or a different port will not work because Silverlight only looks at port 80 on the root web directory.</p> <p>Obviously I can just copy the ClientAccessPolicy.xml into the web root directory and disable the policy endpoint. Is there a way to button-down the endpoint so that it only hijacks calls to ClientAccessPolicy.xml but does not steal the entire IIS port 80?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload