c# - "An attempt was made to load a program with an incorrect format"

标签 c# linq video ffmpeg

我在 visual studio 2008 中工作,运行程序时显示此错误:

$exception {"Could not load file or assembly 'AForge.Video.FFMPEG, Version=2.2.5.0, Culture=neutral, PublicKeyToken=03563089b1be05dd' or one of its dependencies. An attempt was made to load a program with an incorrect format."}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AForge.Video.FFMPEG;

namespace WindowsFormsApplication9
{
    public partial class Form1 : Form
    {        
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            VideoFileReader video = new VideoFileReader();
        }
    }
}

我的程序有什么问题?

最佳答案

这通常是尝试在 x64 系统上加载 x86 二进制文件(反之亦然)的结果。检查您的程序是否编译为与您正在使用的二进制文件相同的目标(在本例中为 AForge.Video.FFMPEG)。

关于c# - "An attempt was made to load a program with an incorrect format",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20739849/

相关文章:

c# - 重定向输出时 ResGen.exe 卡住

c# - UWP x :Bind with time

c# - 在 C# 中将列表列表分成相等的部分

c# - 检查属性是否为 null LINQ

c# - 将类映射到表名不同但列结构相同的表

c++ - 如何OPENCV + CUDA + VideoCapture?

c# - 数据模板 x :Bind namespace error

c# - 自定义 Rx 运算符,仅在有最近值时才进行节流

video - 如何通过javascript在像ffmpeg风格的 Canvas 中绘制马赛克?

android - Android 上的 ffmpeg 解码