Silverlight clientaccesspolicy.xml error? or design?

In the node domain of the clientaccesspolicy file, you can specify a wildcard for the subdomain or protocol, but it will not be displayed for the port.

In particular, when developing, if the consumed service is hosted by a third-party user, access to the local version of the debug version of the silverlight application running on the localhost asp.net development server works fine with the nodes:

<domain uri="*"/> <domain uri="http://*"/> <domain uri="http://localhost:1234"/> 

(where 1234 is the specific specific port number)

but it does not work if specified on the form

 <domain uri="http://localhost:*"/> 

which is extremely annoying if there are several developers / projects using this service, or you do not specify a port for the asp.net development server

Does annyone know if I just get the wrong format, or is it either an error or an oversight when processing clientaccesspolicy using silverlight?

+7
source share
2 answers

The behavior you describe is consistent with the documentation that says:

There are three types of wildcards allowed:

Standalone '*' template. This parameter is used to access all domains of the same schema. The HTTP service will allow all HTTP subscribers. The HTTPS service will allow all HTTPS callers.

The wildcard character is "http: // *". This option explicitly allows all HTTP callers, even if it is an HTTPS service.

Wildcard Subdomain. This option uses a wildcard in the first path segment ("http: //.contoso.com", for example), which allows all subdomains of the specified domain. Therefore, for an example. http://web.contoso.com and http://mail.contoso.com will be allowed. Note that the uri path where the wildcard does not occur as a prefix ( http: // web ..com, for example) is not allowed.

http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx

So, nothing about patterns for ports that (you're right) make no sense when you allow wildcards for hosts and domains.

+6
source share

Work around:

In the Properties section of your web site where the SL application is hosted, go to the Web tab and change the "Automatically assign port" setting to a Specific port . Thus, you can set your localhost: 1234 port in the clientaccesspolicy file, as you already showed, and expect that he will not need a port change, no matter which developers also use the project.

This is not an ideal solution, since it is always better to assign a car, rather than hard-installed ports in projects. But its a good option to try.

+3
source share

All Articles