使用Web服务wcf和状态404错误未找到

时间:2012-08-21 20:37:23

标签: asp.net wcf

我已将两个文件:clientaccesspolicy.xml和crossdomain.xml复制到我的web asp.net应用程序的根文件夹,并从Visual Studio以调试模式运行。 VS上的调试链接是:http://localhost:4801/当我打开Silverlight页面链接到Web服务时我得到了这些错误:

> Failed to load resource: the server responded with a status of 404
> (Not Found) 
>     http://localhost/clientaccesspolicy.xml
>     
>     Failed to load resource: the server responded with a status of 404 (Not Found) 
>     http://localhost/crossdomain.xml

如何在localhost上调试Web服务?我已经在服务器上上传了网站,看起来很好。

1 个答案:

答案 0 :(得分:1)

我有一个类似的问题,我正在调试一个ASP.NET网站,但我的路由无法正确处理特殊端口,例如登录到应用程序需要重定向。现在,我的下一个目标是找出一种方法使网站与端口无关,这就是我如何解决端口问题

由于您的应用程序试图访问标准端口80上的资源,因此它会失败,因为它正在侦听端口4801上的http。我对https有同样的问题(标准是443)。解决此问题的方法是检查哪些程序占用localhost上的这些端口,并将它们更改为其他端口或在调试时停止它们。这个答案有一个很好的工具来检查:

https://stackoverflow.com/a/105487/943432

我似乎记得Skype是我的问题。由于http.sys,您可能在Windows 7上的localhost上清除端口80时遇到问题。请参阅此问题以了解如何解决该问题:

http://localhost/ not working on Windows 7. What's the problem?

相关问题