MissingMethodException

M

Mark Volstad

All of a sudden (yeah, I know I must have changed
SOMEthing...) I am getting the following error when I try
to deploy my CE app to the emulator: "An unhandled
exception of type 'System.MissingMethodException'
occurred in System.Windows.Forms.dll". If I attempt to
reproduce this by creating a trivial smart device app
that contains a single empty form, I don't see the error.
As soon as I add an empty Try...Catch block to the form's
Load event handler, the error occurs. The code compiles
fine, though. When I step through in debug mode, I find
that the error occurs on:

Application.Run(New Form1())

in the "Sub Main" of the designer-generated code section.
What should I be looking for?

Mark
 
M

Mark Volstad

Hi Geoff,

My reduced form code is below. When I remove the
Try/Catch block, the form loads fine. Otherwise, I get an
error the second time the "Application.Run(New Form1())"
line is hit when the form loads in debug mode. Obviously,
there must be something in my environment that is causing
this. I've opened a support incident with MSFT and will
post the solution here when I get one.

Mark


Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()

MyBase.New()

'This call is required by the Windows Form
Designer.
InitializeComponent()

'Add any initialization after the
InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component
list.
Protected Overloads Overrides Sub Dispose(ByVal
disposing As Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the
Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private Sub InitializeComponent()
'
'Form1
'
Me.ClientSize = New System.Drawing.Size(194, 106)
Me.Text = "Form1"

End Sub

Public Shared Sub Main()
Application.Run(New Form1())
End Sub

#End Region

Private Sub Form1_Load(ByVal sender As Object, ByVal
e As System.EventArgs) Handles MyBase.Load

Try

Catch ex As Exception

End Try

End Sub
End Class
 
G

Geoff Schwab [MSFT]

Hi Mark,

I cannot seem to reproduce the problem with the 2003 Emulator. The part
that disturbs me a bit is that in your message you say "Otherwise, I get an
error the second time the "Application.Run(New Form1())" line is hit when
the form loads in debug mode." How is it that you are hitting this twice?
Is this twice in the same debugging session or is it the next time you debug
the application? If it is the latter, are you sure the application is
shutting down properly - Start->Settings->System->Memory->Running Programs?
We just added a new section to the FAQ that may help you as well:

11. Connectivity
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx#11.0

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Mark Volstad

Sorry for the confusion. What I meant was that when I hit
this line in debug mode, I can step into it (to Sub New
(), Sub InitializeComponent...) and the error does not
occur until code processing returns to this line line.

I have created a brand new SmartDevice project in VS,
added a single, empty form to the project, and the error
occurs as soon as I add an empty Try/Catch block to the
form's Load event handler. This is so bizarre that I
really don't expect anyone to be able to reproduce it.
I'm sure there's something about my environment that's
not quite right, but I've gone so far as to re-install
Visual Studio without making any headway. What's left --
a complete Windows XP re-install??

Mark
 
G

Geoff Schwab [MSFT]

Hi Mark,

Can you email me the project and binary directly? Just take the "online"
out of my email address. That way I can build the same project and compare
the binaries.

Is this specific to the emulator and/or device? If it is an emulator issue,
which one(s) have you tried? If it is device specific, which OS is it
running?

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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