将 clientaccesspolicy.xml (和crossdomain.xml ) 放到wwwroot或者网站根目录下
<?xml version="1.0"?>
clientaccesspolicy.xml
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
crossdomain.xml
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
在添加的图层那加一个InitializationFailed 事件 事件实现里 写
Layer layer= sender as Layer;
MessageBox.Show(layer.InitializationFailure.Message);
如果有问题,会显示,有时可能图层类型给错了。