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
在Silverlight 3中使用MediaElement时System.OutOfMemoryException_Silverlight_Expression Blend_Mediaelement - Fatal编程技术网

在Silverlight 3中使用MediaElement时System.OutOfMemoryException

在Silverlight 3中使用MediaElement时System.OutOfMemoryException,silverlight,expression-blend,mediaelement,Silverlight,Expression Blend,Mediaelement,我正在尝试使用MediaElement标记构建一个简单的Silverlight 3 MediaPlayer: <Border Margin="8,8,0,8" Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1" CornerRadius="7">+ <MediaElement x:Name="FighterPilot" Source="http://localhost/repository/F

我正在尝试使用MediaElement标记构建一个简单的Silverlight 3 MediaPlayer:

<Border Margin="8,8,0,8" Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1" CornerRadius="7">+
<MediaElement x:Name="FighterPilot" Source="http://localhost/repository/FighterPilot.wmv" Stretch="Fill"/>
</Border>
+
这对于低分辨率wmv文件非常有效。但是当一个WMV文件具有720p的分辨率时,我得到了构建错误

Xap打包失败: System.OutOfMemoryException

有人知道我为什么会出现这个构建错误吗

感谢您在这方面的帮助


更新:我正在开发的电脑有大量的可用内存,所以内存应该不会有问题。

不,我从来没有遇到过这个问题。简单的解决方案是在Silverlight项目中不包含wmv文件。您可以将其添加到ASP.NET项目中的某个位置,以避免它一起打包到xap中。

假设您使用的是Visual Studio,并且WMV文件位于Silverlight项目中,请将WMV文件的生成操作设置为“无”,并将“复制到输出目录”设置为“始终复制”。这样它就不会与XAP文件捆绑在一起

或您可以考虑将WMV文件放在网站中的CclitBin文件夹下的“视频”目录中,然后可以使用以下内容访问:

FighterPilot.Source = new Uri("/Video/FighterPilot.wmv", UriKind.Relative);
这篇文章有一个答案:

谢谢!我从项目中删除了WMV文件,它工作起来很可怕。