Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Generation Error Adding User Control to Form
Message
 
To
29/03/2007 12:49:15
Duncan Mcdonald
Canadian Natural Resources Ltd
Calgary, Alberta, Canada
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows 2000 SP4
Database:
Oracle
Miscellaneous
Thread ID:
01209888
Message ID:
01210236
Views:
15
Duncan,

>I have built a User Control that contains an MM Business Object and a grid to present the BO's data. When I go to place this UC on a form, I get the following error:
>
>"Code generation for property 'State' failed. Error was: 'The value '0' is not a valid value for the enum 'mmBusinessSate'."
>
>Anytime I change anything on the form, the error occurs and recurs each time I save or rebuild until I close and reload the Solution.
>
>When I look in the Form's designer code, it has rendered/created the Business object in the form itself, which shouldn't be the case since the Business object is handled in the User Control.
>
>I suspect this has something to do with Serialization and it may not be specific to MM, but any thoughts/feedback/workarounds for this issue would be much appreciated. Thanks very much...

I recommend checking out the code in the constructor of your user control (and in your properties for that matter) and make sure there isn't any code that is dependent on a runtime object. Visual Studio "runs" the constructor of your components at design time. Check out the MM .NET Dev guide topic "Why do I get errors when I open a component in design mode" for details.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform