【问题标题】:Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime混合模式程序集是针对运行时版本“v1.1.4322”构建的,无法在 4.0 运行时中加载
【发布时间】:2012-08-03 19:15:47
【问题描述】:

我正在尝试制作一个简单的视频播放器,所以我不会使用

Microsoft.DirectX.AudioVideoPlayback.dll

但是当我使用这个 dll 文件程序时会引发这个错误

混合模式程序集是针对版本“v1.1.4322”构建的 运行时并且不能在没有额外的 4.0 运行时中加载 配置信息。

在打开文件对话框出现之前 在这段代码中

private void button1_Click(object sender, EventArgs e)
{
    int width = this.panel1.Width,
        height= this.panel1.Height;

    OpenFileDialog open = new OpenFileDialog();
    open.ShowDialog();

    ss = new Video(open.FileName, false);

    ss.Owner = panel1;
    ss.Size = new Size(width, height);

    ss.Play();
    ss.Stop();
}

我正在搜索这个,我在 StackOverflow 上找到了一些解决方案:

  1. Mixed Mode Error when building in Release Mode
  2. Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot
  3. Mixed mode assembly is built against version 'v1.1.4322'

但我不知道如何解决此错误,因此任何人都有其他解决方案或可以解释其中任何一个。如果需要编辑文件,请告诉我该文件的位置。

非常感谢

【问题讨论】:

    标签: c# runtime assemblies mixed-mode


    【解决方案1】:


    您正在寻找的是您的应用程序的 App.config。 它应包含以下 xml:

    <?xml version="1.0" encoding="utf-8" ?> 
    <configuration> 
      <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 
      </startup> 
    </configuration> 
    

    此信息显示在您提供的链接中。

    【讨论】:

    • 在哪里可以找到 App.config 文件。你能给我路径吗
    • 它应该在您的 Windows 应用程序项目中。如果它不存在,您可以随时自行添加。只需使用该名称创建一个文件,将其放在项目的根文件夹中并粘贴上面的 XML。
    猜你喜欢
    • 2012-08-11
    • 2013-01-08
    • 1970-01-01
    • 2011-04-30
    • 2011-09-19
    • 2015-05-28
    • 1970-01-01
    • 2018-03-15
    • 2016-05-08
    相关资源
    最近更新 更多