Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法远程获取wcf服务_Wcf_Silverlight - Fatal编程技术网

无法远程获取wcf服务

无法远程获取wcf服务,wcf,silverlight,Wcf,Silverlight,我有两个系统,一个是本地主机(Windows8.1Pro),另一个是虚拟机(WindowsServer2008R2)。 我有一个silverlight应用程序托管在VM中,它正在使用windows服务中安装的localhost提供的WCF服务 问题: silverlight未获取clientaccesspolicy.xml和crossdomain.xml,因此不会获取wcf服务 尝试过的解决方案: 在安装之前,在WCF服务解决方案中添加了clientaccesspolicy.xml和crossd

我有两个系统,一个是本地主机(Windows8.1Pro),另一个是虚拟机(WindowsServer2008R2)。 我有一个silverlight应用程序托管在VM中,它正在使用windows服务中安装的localhost提供的WCF服务

问题:

silverlight未获取clientaccesspolicy.xml和crossdomain.xml,因此不会获取wcf服务

尝试过的解决方案:

  • 在安装之前,在WCF服务解决方案中添加了clientaccesspolicy.xml和crossdomain.xml,但仍然无法从WCF服务url获取

  • 根据我的搜索,在C:\inetpub\wwwroot文件夹中添加了clientaccesspolicy.xml和crossdomain.xml,许多人建议将其放置在silverlight自动获取的位置

  • 尝试将clientaccesspolicy.xml代码添加到wcf服务中,但未成功

  • 如有任何建议,将不胜感激

    编辑: 好的,我附上代码FYR,我这样做如下

  • 一旦我构建了WCFTest,我将获得.exe wcf安装程序,我正在使用installutil.exe安装它,所以服务将在services.msc中启动并运行

  • 一旦我构建了TestSL,我就会得到TestSLTestPage.html,双击它就会在IE中打开,点击按钮我就会从WCF得到“Hello World”

  • 如果我做错了什么,请告诉我。所附项目的结构与我所从事的完全相同

    问候,


    Jithendra

    正如我在上面解释的问题,我使用的是自托管Wcf服务,无法解决问题,所以下面是我所做的

    1. Created Default WCF Service application in VS2013 with all my code and added clientaccesspolicy.xml and crossdomain.xml in the solution.
    2. Created a new website in IIS Manager to publish my project.
    3. and published my project to IIS as filesystem.
    4. There we'll have all the files that are necessary.
    
    瞧,一切都很完美


    希望它能帮助别人。

    有什么帮助吗???那可以解决我的问题。