【发布时间】:2011-09-29 08:35:22
【问题描述】:
我似乎在这个问题上遇到了一些问题 - 尽管在 XP Pro IIS5.1 上一切正常,但在 IIS 6 上,我在过去几天尝试了所有方法来让 silverlight 简单地播放 .wma 文件当 .wma 文件扩展名在 IIS 中映射到 .Net(通过主目录> 配置,将扩展名映射到 c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll。) - 没有成功!只要 .wma 文件类型未映射到 .net,文件就可以正常播放,但一旦映射,我就会不断收到通用的“System.Exception - 3137”错误消息 - 我认为这是一个文件找到/文件无法访问的消息。
不会播放的 .wma 文件不会作为资源编译到 silverlight .xap 中 - 我正在尝试访问它,它只是服务器上文件夹/文件结构的正常部分。我尝试了许多不同的路径组合,但大概路径是正确的,因为当 .wma 扩展名未映射到 .net 时文件播放正常。 SL 应用程序中设置源的代码是: mediaPlayer.Source = new Uri("http://www.thedomainname.org.uk/radio/featuredartistsplaylists/poprock.wma", UriKind.Absolute); - 虽然我也尝试过来自 .xap 文件的相对路径(带和不带前导“/”),绝对路径使用 ip 地址而不是域名(导致网络错误)和后面的相对文件系统路径\slash 格式(导致网络错误)。 - 对于身份验证,在 IIS 上为 Windows 用户帐户 IUSR_HOST-7418 启用了匿名访问,并且根本没有在 web.config 中设置模式我尝试将其设置为 mode="none" 和 mode="windows"
我的网络托管设置是一个运行 Windows Server 2003 Standard 的 VPS。我真的不知道我在做什么,但我尝试了以下没有效果:
- In the IIS configuration mapping dialogue, trying with the 'verify that file exists' checkbox checked and unchecked
- adding a <httpHandlers> entry for .wma in the <system.web> tag of web.config as follows :
<path "*.wma" verb="*" type="System.Web.UI.PageHandlerFactory" validate="false" />
(and tried it with validate="true")
- running the request with and without a global.asax and with a code-free Application_BeginRequest event - in case my code in global.asax was blocking access to the .wma
- granted Read & Execute rights on the folder containing the .wma to both the Internet Guest Account(HOST-7418\IUSR_HOST-7418) and Users(HOST-7418/Users) Account.
此时,除了怀疑这是某种文件/文件夹访问问题而不是路径问题之外,我几乎没有想法 - 尤其是因为我在 Windows Server 2008 (IIS 7 ) VPS 设置 - 仅在未映射到 .net(使用编译的处理程序/模块)时再次播放 .wma 文件,否则由于“System.Exception : 2210 AG_E_INVALID_ARGUMENT”错误代码而拒绝播放。
非常感谢任何帮助。
【问题讨论】:
-
Geoff:将wma的URL直接放在IE的地址栏中会发生什么?
-
感谢您的回复。我刚刚收到以下标准错误消息“无法显示该页面您要查找的页面当前不可用。该网站可能遇到技术问题,或者您可能需要调整浏览器设置。”
-
我刚刚检查过,我的 global.asax 代码正在拦截来自媒体播放器的 .wma 文件请求(应该如此),但即使所有代码都不是适用于非付费文件的请求,访问被拒绝。
标签: .net silverlight iis-6