使用Microsoft.DirectX.AudioVideoPlayback播放视频时出错;程序集版本错误 [英] Error playing video using Microsoft.DirectX.AudioVideoPlayback; assembly version error

查看:1064
本文介绍了使用Microsoft.DirectX.AudioVideoPlayback播放视频时出错;程序集版本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用程序集 Microsoft.DirectX.AudioVideoPlayback 将视频嵌入基于c#Windows窗体的应用程序中,但出现以下错误

I am trying to embed video on c# windows form based application, using assembly Microsoft.DirectX.AudioVideoPlayback but getting following error

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

我正在使用Visual Studio 2010 .NET版本4.0 还安装了Microsoft DirectX SDK 是否提供了库更新版本的链接或其他替代方法?

I am using Visual Studio 2010 .NET version 4.0 Microsoft DirectX SDK is also installed Any link for updated version of library or any alternative?

代码:

using Microsoft.DirectX.AudioVideoPlayback;
namespace MathBook
{
    public partial class Form1 : Form
    {
        Video vd;
        public Form1()
        { InitializeComponent(); }

        private void Form1_Load(object sender, EventArgs e)
        { }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                vd = new Video(@"absolute_file_location.wmv", true);
                vd.Owner = panel1;
                vd.Play();
            }
            catch (Exception ex) { }
        }
    }
}

推荐答案

,因为错误消息表明您需要其他配置信息.

as error message says you need additional configuration information.

在应用程序配置中将 useLegacyV2RuntimeActivationPolicy 设置为true文件

set useLegacyV2RuntimeActivationPolicy as true in your app config file

<startup useLegacyV2RuntimeActivationPolicy="true">
   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

这篇关于使用Microsoft.DirectX.AudioVideoPlayback播放视频时出错;程序集版本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆