在 IIS 7.5 上托管 Silverlight 应用程序时出现问题
我有一个 ASP.NET Web 应用程序 (.NET 4.0),它有几个页面,其中一个页面中有一个 silverlight 应用程序。
当我在本地调试时,silverlight 应用程序运行良好。当我部署到 Web 服务器(Windows Server 2008 R2、IIS 7.5)时,silverlight 应用程序将不会显示。
我在 Application_Error 中遇到异常,说缺少以下文件:
clientaccesspolicy.xml
crossdomain.xml
我在网上发现了一些不太有帮助的东西 - 他们说它们需要位于 C:\inetpub\wwwroot 中。我在 IIS7.5 中没有“默认”网站并且没有这些文件夹?
我在哪里可以找到它们以及应该将它们放在哪里?
请帮忙,因为这非常紧急。非常感谢。
编辑:所以我尝试按照我的评论中的链接建议进行操作。更多信息:我有一个支持 Silverlight 的 WCF 服务,Silverlight 应用程序使用该服务来工作。
使用 .svc 文件部署应用程序时,我需要执行任何特殊操作吗?我记得必须在 IIS5 中启用对 .svc 文件的访问,但我不知道在 IIS 7.5 中是否有必要?
希望这些额外信息有帮助。如果您需要任何代码片段等,请告诉我。
谢谢。
I have an ASP.NET web application (.NET 4.0) that has a few pages, one page with a silverlight application in it.
When I debug locally, the silverlight app works fine. When I deploy to my web server (Windows Server 2008 R2, IIS 7.5), the silverlight app will not display.
I get an exception in Application_Error saying the following files are missing:
clientaccesspolicy.xml
crossdomain.xml
I have found a few things on the net that aren't very helpful - they say they need to be in C:\inetpub\wwwroot. I don't have a 'Default' website in IIS7.5 and I don't have these folders?
Where can I find them and where should I put them?
Please help, as this is very urgent. Many thanks.
EDIT: So I have tried doing what the link in my comment suggests. Some more info: I have a Silverlight-enabled WCF service that the Silverlight app uses in order to work.
Do I need to do anything special when deploying my app with an .svc file? I remember having to enable access to .svc files back in IIS5, but I don't know if that's necessary in IIS 7.5?
Hope this extra info helps. If you need any code snippets etc, let me know.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,解决了 - 一个有点尴尬和烦人的问题..............
Silverlight应用程序中的服务引用有一个客户端地址'http://localhost......',这是我添加服务引用时由 Visual Studio 添加的。
我发现了 Tim Heuer 的博客文章描述了该问题。我必须使用 ServiceReferences.ClientConfig 中的“../Service.svc”将客户端地址设置为相对地址。
非常烦人,请微软解决!
Well, worked it out - a slightly embarrassing and annoying problem..............
The service reference in the Silverlight application had a client address of 'http://localhost......', which was added by Visual Studio when I added the service reference.
I found a blog post by Tim Heuer describing the issue. I had to set the client address to a relative one, using '../Service.svc' in the ServiceReferences.ClientConfig.
Very annoying, sort that out please Microsoft!!!