Aurelian
Aurelian

Reputation: 11

MissingMethodException in C# Program

I wrote a Windows Form Application in C# and it works well for my computer. But on another PC, an error occurs when I try to do some stuff.

MenuItem_Click Event Handler

private void rUNToolStripMenuItem_Click(object sender, EventArgs e)
{
    MessageBox.Show("I'm in rUNToolStripMenuItem_Click!");
    ...

}

ToolStripMenuItem Event Handler

private void dataPositionToolStripMenuItem_Click(object sender, EventArgs e)
{
    MessageBox.Show("I'm in dataPositionToolStripMenuItem_Click!");
    ...    
}

Running on my computer:

MenuItem_ClickEvent Handler Output (On My PC)

MessageBox appears: "I'm in rUNToolStripMenuItem_Click"

ToolStripMenuItem Event Handler (On My PC)

MessageBox appears: "I'm in dataPositionToolStripMenuItem_Click!"

MenuItem_Click Event Handler: (On another PC)

Messagebox doesn't appear and an Exception is thrown
Method not found: "Void    
Microsoft.CSharp.RuntimeBinder.CSharpGetMemberBinder.ctor(
System.String.System.Type, System.Collections.Generic.IEnumerable'1<Microsoft 
.CSharp.RuntimeBinder.CSharpArgument Info>)'.

This is the PrintScreen with error:
Screen Capture http://img51.imageshack.us/img51/589/errorts.jpg

What am I doing wrong?

Upvotes: 1

Views: 3157

Answers (2)

James
James

Reputation: 82096

When developing applications in .NET you need to ensure the host environment has the same version of the .NET framework that your application is targeting.

If you right click on your application from the solution explorer, go to properties then select the Application tab you can specify (or confirm) what framework your application is using, this will be the version you will have to install.

If you have a setup project you can make the .NET framework a pre-requisite (basically makes the user install that before they can install the application) so you don't have issues like this...

Upvotes: 2

ANC_Michael
ANC_Michael

Reputation: 282

does the other computer have the correct version of the .net runtime installed on it for which you built that application too?

Upvotes: 4

Related Questions