NotSupportedException on VGA emulator

M

Matt Young

I've encountered a bug in the WWE PPC 2003 SE VGA emulator.

When I instantiate a form, a System.NotSupportedException is thrown in the
constructor on the InitializeComponent() method call. When I attempt to
walk through in the debugger, the exception is thrown before the first line
of code in InitializeComponent is reached. This happens in debug and release
mode.

This exception happens on only one form in our application. This form's
InitializeComponent method has 203 local variables, more than any other form
in the application (may be related).

I cannot reproduce the exception on a VGA Dell Axim x50v, it seems to be
specific to the emulator.

Matt
 
D

Daniel Moth

It's specific to the non-ARM JIT. No method can be larger than 64K (native
size).

Cheers
Daniel
 
M

Matt Young

Found a post that sounds like the same problem.

"When executing my Smart device application on the Windows CE emulator, I
got a “NotSupportedException". What was even stranger, was that I got this
in the InitializeComponents method, which is generated by Visual Studio. ...
when the InitializeComponents method contains more than 937 lines of code,
it crashes in the emulator. "
http://www.digital-transition.com/archives/2005/limitations-of-windows-ce-emulator/

Is this a known issue? Is there a fix?
 
A

Alex Feinman [MVP]

This is a known limitation. There is no fix. The recommendation is to avoid
setting non-critical properties via designer, but instead do it
programmatically. For example let's say specifying control's font in the
designer results in about 500 bytes of x86 code. If you do it for 20
controls, you get 10K right there. My point is that unlike
size/position/colors the font setting is not critical for you to be able to
see the form look in the designer. Move all code that sets font to a
separate method and invoke it from the constructor, right after call to
InitializeComponent. Similarly move all other non-critical code like
populating dropdowns etc out of InitializeComponent. Basically you want your
control property sheets to have as little bold black items (the ones that
are set to values other than defaults) as possible
 

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