Click here to Skip to main content
15,671,318 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to run a small application in C# on visual studio 2010 that extracts frames from a video.
When I tried to build the solution it gave me the following warning:

"There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "MWArray , version = , culture=neural , publicKeyToken=e1d84a0da19db86f, processorArchitecture=AMD64 , "x86" . this mismatch may cause runtime failures. please consider changing the targeted processor architecture of your project through the configuration manager so as to align the processor architecture between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project."

right now i tried to change the project configuration to x86. now the warning is now disappeared.

i tried to start debug the program is gives an error .

TypeInitializationException was unhandled.

////// code//////////////////////

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 finalNative;

using MathWorks.MATLAB.NET.Arrays;

using MathWorks.MATLAB.NET.Utility;

namespace check

public partial class Form1 : Form


finalNative.edit mtb = new finalNative.edit(); ////////////// ... >>here is the error message

static object Val;

public Form1()



private void button1_Click(object sender, EventArgs e)


OpenFileDialog fdlg = new OpenFileDialog();

fdlg.Title = "Select File ";

fdlg.Filter = "All files (*.*)|*.*|All files (*.avi)|*.avi";

fdlg.FilterIndex = 2;

fdlg.RestoreDirectory = true;


if (fdlg.FileName != string.Empty)


textBox1.Text = fdlg.FileName;



textBox1.Text = "Please Select .avi file before submit the form ! ";

Val = textBox1.Text;


private void button2_Click(object sender, EventArgs e)

if (textBox1.Text != String.Empty)
makeframe.Enabled = false;
label2.Enabled = false;
MessageBox.Show("Video Converted into Frames!");



private void button3_Click(object sender, EventArgs e)
MessageBox.Show("Frames Color Should be changed and Saved !");
formating.Enabled = false;
label3.Enabled = false;


private void makevideo_Click(object sender, EventArgs e)
MessageBox.Show("Video Creation complete And Saved with Name "+"resultant video.avi");
makevideo.Enabled = false;
label4.Enabled = false;


private void exit_Click(object sender, EventArgs e)



private void textBox1_TextChanged(object sender, EventArgs e)


private void label1_Click(object sender, EventArgs e)


private void button1_Click_1(object sender, EventArgs e)


private void Form1_Load(object sender, EventArgs e)



please tell me how to handle this exception.

1 solution

The version of MWArray.dll you have is built fro AMD64 processors, while your current project is configured to MSIL (processor independent). You can not use such a dll (processor specific) from your project (processor independent)...
You have two options:
1. Get a MSIL version of MWArray.dll
2. Build your project for AMD64
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900