An unhandled exception of type 'System.MissingMethodException' occurred in CCubedApplication.exe

C

Claire

Why should I get this error? The error message is displayed in my debugger
and not on the pocketpc device. The application then fails to run.
It refers to my InitializeComponent() function in my main form. It's just
started happening for no apparent reason. The function is definately there,
I can see it!!

I assume that the method can't be found when the application starts running
as surely the compiler would complain if the method wasnt there at compile
time.
I've done several rebuilds and restarted visual studio in an attempt to
clear it up.

public FrmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();// << error thrown here
// Set the buttons
Connected = false;
if (DataHelper.DatabaseExists == false)
cmdConnect.Enabled = false;
else
UpdateTotalReadings();
 
C

Claire

Daniel Moth said:
How large is that method? There is a limit.

Cheers
Daniel

Hi Daniel
Only approx 100 lines in my InitializeComponent() function. I only have a
few labels and 4 buttons on the form.
I've tried re-creating my solution just in case it was a corrupt project
file but it also does it in the new version.
The program works fine on the emulator but it fails when run on the PocketPC
device.
 
D

Daniel Moth

Let's exclude the device as the culprit.
1. Create a brand new Smart Device project with a default Form and do not
modify it at all
2. Run it on the device

Does it work?

If it does, now modify the form to your liking. Do not touch the
InitializeComponent code and don't add any code manually. Run it on the
device.

Does it work?

If it does, compare the two projects and see what is different. What else
are you referencing? Are there any PInvokes in the project (DllImport)?

Cheers
Daniel
 
C

Claire

Thanks Sergey
I deleted the project directories on both PocketPC and PC. It didn't work
Still getting the problem.
 
C

Claire

Hi Daniel
I created a new one and it ran fine. Mine has been working fine until today
What there IS in the project that is "complex" is a Web Reference to a SOAP
server.
I did "update" the web reference today. I don't know if that caused
something.
Again, it works in the emulator and not the pocketpc
 
D

Daniel Moth

So you don't have any dllimports. OK, in the brand new project that you
created that run, add the web reference and see if it still works.

Also can you paste here the 100 lines from the InitializeComponent?

Cheers
Daniel
 
C

Claire

I added the web reference to the empty project. It worked ok.
I don't know about dllimports. Although I haven't added any myself we're
using some third party components. OpenNetCF compact framework controls and
InTheHand ADO database classes. The InTheHand ADO classes are new ones we
haven't used before, we've used the OpenNetCF ones on a previous project
with no worries.
As I wrote, it just started happening yesterday. The project's been in
development for maybe 3-4 days.
private void InitializeComponent()

{

this.mnuMain = new System.Windows.Forms.MainMenu();

this.cmdConnect = new OpenNETCF.Windows.Forms.ButtonEx();

this.panel1 = new System.Windows.Forms.Panel();

this.lblLoggedOnAs = new System.Windows.Forms.Label();

this.cmdReceive = new OpenNETCF.Windows.Forms.ButtonEx();

this.cmdReadings = new OpenNETCF.Windows.Forms.ButtonEx();

this.cmdTransmit = new OpenNETCF.Windows.Forms.ButtonEx();

this.lblSiteID = new System.Windows.Forms.Label();

this.label1 = new System.Windows.Forms.Label();

this.label2 = new System.Windows.Forms.Label();

this.lblTotalReadings = new System.Windows.Forms.Label();

//

// cmdConnect

//

this.cmdConnect.BackColor = System.Drawing.Color.Yellow;

this.cmdConnect.Font = new System.Drawing.Font("Tahoma", 8F,
System.Drawing.FontStyle.Bold);

this.cmdConnect.Location = new System.Drawing.Point(70, 56);

this.cmdConnect.Size = new System.Drawing.Size(100, 23);

this.cmdConnect.Text = "Logon";

this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);

//

// panel1

//

this.panel1.BackColor = System.Drawing.Color.Yellow;

this.panel1.Location = new System.Drawing.Point(10, 92);

this.panel1.Size = new System.Drawing.Size(220, 2);

//

// lblLoggedOnAs

//

this.lblLoggedOnAs.Font = new System.Drawing.Font("Arial", 7F,
System.Drawing.FontStyle.Bold);

this.lblLoggedOnAs.ForeColor = System.Drawing.Color.White;

this.lblLoggedOnAs.Location = new System.Drawing.Point(56, 8);

this.lblLoggedOnAs.Size = new System.Drawing.Size(264, 20);

this.lblLoggedOnAs.Text = "Not established";

//

// cmdReceive

//

this.cmdReceive.BackColor = System.Drawing.Color.Yellow;

this.cmdReceive.Enabled = false;

this.cmdReceive.Font = new System.Drawing.Font("Tahoma", 8F,
System.Drawing.FontStyle.Bold);

this.cmdReceive.Location = new System.Drawing.Point(70, 108);

this.cmdReceive.Size = new System.Drawing.Size(100, 23);

this.cmdReceive.Text = "Receive";

this.cmdReceive.Click += new System.EventHandler(this.cmdReceive_Click);

//

// cmdReadings

//

this.cmdReadings.BackColor = System.Drawing.Color.Yellow;

this.cmdReadings.Enabled = false;

this.cmdReadings.Font = new System.Drawing.Font("Tahoma", 8F,
System.Drawing.FontStyle.Bold);

this.cmdReadings.Location = new System.Drawing.Point(70, 148);

this.cmdReadings.Size = new System.Drawing.Size(100, 23);

this.cmdReadings.Text = "Take readings";

this.cmdReadings.Click += new System.EventHandler(this.cmdReadings_Click);

//

// cmdTransmit

//

this.cmdTransmit.BackColor = System.Drawing.Color.Yellow;

this.cmdTransmit.Enabled = false;

this.cmdTransmit.Font = new System.Drawing.Font("Tahoma", 8F,
System.Drawing.FontStyle.Bold);

this.cmdTransmit.Location = new System.Drawing.Point(70, 232);

this.cmdTransmit.Size = new System.Drawing.Size(100, 23);

this.cmdTransmit.Text = "Transmit";

this.cmdTransmit.Click += new System.EventHandler(this.cmdTransmit_Click);

//

// lblSiteID

//

this.lblSiteID.Font = new System.Drawing.Font("Arial", 7F,
System.Drawing.FontStyle.Bold);

this.lblSiteID.ForeColor = System.Drawing.Color.White;

this.lblSiteID.Location = new System.Drawing.Point(56, 32);

this.lblSiteID.Size = new System.Drawing.Size(268, 20);

this.lblSiteID.Text = "Not established";

//

// label1

//

this.label1.Font = new System.Drawing.Font("Arial", 7F,
System.Drawing.FontStyle.Bold);

this.label1.ForeColor = System.Drawing.Color.White;

this.label1.Location = new System.Drawing.Point(-4, 8);

this.label1.Size = new System.Drawing.Size(52, 20);

this.label1.Text = "User ID:";

this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;

//

// label2

//

this.label2.Font = new System.Drawing.Font("Arial", 7F,
System.Drawing.FontStyle.Bold);

this.label2.ForeColor = System.Drawing.Color.White;

this.label2.Location = new System.Drawing.Point(-4, 32);

this.label2.Size = new System.Drawing.Size(52, 20);

this.label2.Text = "Site ID:";

this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight;

//

// lblTotalReadings

//

this.lblTotalReadings.Font = new System.Drawing.Font("Arial", 7F,
System.Drawing.FontStyle.Bold);

this.lblTotalReadings.ForeColor = System.Drawing.Color.White;

this.lblTotalReadings.Location = new System.Drawing.Point(12, 204);

this.lblTotalReadings.Size = new System.Drawing.Size(216, 20);

this.lblTotalReadings.Text = "Completed readings: none";

//

// FrmMain

//

this.BackColor = System.Drawing.Color.Blue;

this.Controls.Add(this.lblTotalReadings);

this.Controls.Add(this.label2);

this.Controls.Add(this.label1);

this.Controls.Add(this.lblSiteID);

this.Controls.Add(this.cmdTransmit);

this.Controls.Add(this.cmdReadings);

this.Controls.Add(this.cmdReceive);

this.Controls.Add(this.panel1);

this.Controls.Add(this.cmdConnect);

this.Controls.Add(this.lblLoggedOnAs);

this.Menu = this.mnuMain;

this.Text = "Mcm Vib Collector";

}

#endregion
 
C

Claire

I've tracked down the cause but I don't understand what's happening.
The difference Ive noticed between running the application on the Emulator
and the PocketPC device is that I keep getting confirmation about
reinstalling OpenNetCF SDF v1.2 components on the PocketPC everytime I
debug.
To cut a long story short, I created a new application and dropped a single
OpenNetCF button on the form then ran it in both emulator and PocketPC
device.
Again I got the error on the pocketpc alone.

Yesterday, because I was fed up having to keep overinstalling on PocketPC, I
uninstalled opennetcfs controls from it. Afterwards I continued to receive
this message so I thought it must be visual studio that was installing the
package so I forgot about what I'd done.

I still don't understand what's happening here. Should these controls be
being installed permanently by visual studio or should they be temporary?
Even so, why are there be problems with missing methods if they're the same
version?

Dll hell? What do I do about it?
 
A

Alex Feinman [MVP]

Claire said:
I've tracked down the cause but I don't understand what's happening.
The difference Ive noticed between running the application on the Emulator
and the PocketPC device is that I keep getting confirmation about
reinstalling OpenNetCF SDF v1.2 components on the PocketPC everytime I
debug.
To cut a long story short, I created a new application and dropped a
single OpenNetCF button on the form then ran it in both emulator and
PocketPC device.
Again I got the error on the pocketpc alone.

Yesterday, because I was fed up having to keep overinstalling on PocketPC,
I uninstalled opennetcfs controls from it. Afterwards I continued to
receive this message so I thought it must be visual studio that was
installing the package so I forgot about what I'd done.

I still don't understand what's happening here. Should these controls be
being installed permanently by visual studio or should they be temporary?
Even so, why are there be problems with missing methods if they're the
same version?

Dll hell? What do I do about it?

Hard-reset your device and reinstall SDF
 
C

Claire

I tried the same code on another pocketPC and that unit worked ok.
Yes, it took a hard reset to fix the problem. Thanks for all your help
everyone.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top