Large enum - crashes

We have a large enum in out application, with over 7,000 items.

This was causing sporadic crashes in Visual Studio 2005 until we reduced the items in the enum down to about 1,200.

The newer versions of R# crashed more often than the older versions.

Please look into what could have caused this problem, it did not affect every place we referenced the enum, but it was in pages and in the code behind.

I do not have a concrete example to post.

5 comments
Comment actions Permalink

An enum with 7000 (or 1200) items? That would be my best guess as the cause of this problem :) :)

On the basis that this can't possibly be your own code, you should put it onto http://worsethanfailure.com/.

I feel your pain buddy.

0
Comment actions Permalink

Errrmm... don't you think that even 1200 items might be a bit much? Should they really live in your application code?

0
Comment actions Permalink

We really do want to see this code :))

Is it a select-list/dropdown?

0
Comment actions Permalink

Yes, they are required in the code, these are codes that idtenify fields on a page, there are over 50 pages with many fields per page. The fields use this code to load their db record at runtime to determine how they look and behave. It works very well, caching helps of course and allows us customize the application for different customers requirements. You mean you guys hard code page labels, what a hack... :-p

0
Comment actions Permalink

"alastair" <no_reply@jetbrains.com> wrote in message
news:12540789.1178917565506.JavaMail.itn@is.intellij.net...

Yes, they are required in the code, these are codes that idtenify fields
on a page, there are over 50 pages with many fields per page. The fields
use this code to load their db record at runtime to determine how they
look and behave. It works very well, caching helps of course and allows us
customize the application for different customers requirements. You mean
you guys hard code page labels, what a hack... :-p


Personally, I prefer to customize via XML configuration files. They're so
much more flexible than some huge enum, and can be modified without needing
to recompile the application.

John


0

Please sign in to leave a comment.