Business Object causing Visual Studio IDE to crash


Author
Message
Michael Cobb
Michael Cobb
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 26, Visits: 1K
I have a DLL called CommonBOs.DLL containing over 60 business objects.  One of the BOs in that DLL is called PropertyBO. 

In Visual Studio 2005 SP1, I have a VB2005 StrataFrame project with a form that contains an instance of PropertyBO.  Whenever I display the form in design mode the IDE crashes.

I rebuilt and cleaned the project multiple times with the problem continuing to occur.

I started another instance of Visual Studio and attach it to the instance that crashes and sent the debug code to the new instance.  I receive the following message.

System.Reflection.TargetInvocationException was unhandled
Message: Property accessor 'Locked' on object 'PropertyBO1' threw the following exception:'The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1.'

I've rebuilt the business objects, recompiled the DLL and replaced the original DLL in the project.  If I remove the old and drop the new PropertyBO on the form it causes the same problem.  I can reproduce the problem by clicking on the PropertyBO1 instance in design mode.  If I drop other BOs from the DLL onto the form no crash occurs. 

So far I haven't noticed the IDE crashing unless I'm displaying the form in Design mode.

Any ideas on how to troubleshoot this further?

Thanks!

Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, you learn something new every day Smile  Locked is a reserved word used intrinsically within .NET.  The reason it fails is due to the compiler running in the background in VB.NET when the property is being reflected.  This is actually used as a design-time property to determine if the control has been "locked" from being changed, and thus the reason for the compiler dying.  So this is one instance when it may be better to use "LockedValue" or "IsLocked" as your property value.

Just FYI, had to typed it as a Boolean versus a String it probably would not have failed since it was expecting a Boolean data type.

Ben Dornis
Ben Dornis
StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)
Group: Forum Members
Posts: 40, Visits: 155
In the designer of the BO you can change the field name to [Locked] and it will work just fine since the []'s separate it from the keyword in vb.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Actually, not in this case.  The brackets were already in place, and you are right that in most cases this will work, but not this one.  In this case, .NET is looking for the Locked property within the designer which is expected to be a Boolean.  His was typed as a String which caused the VS environment to crash.  Brackets made no difference in this case.
Ben Dornis
Ben Dornis
StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)StrataFrame Novice (84 reputation)
Group: Forum Members
Posts: 40, Visits: 155
Duh. I forgot about actual properties of the control itself.





Just out of curiosity...why don't you allow us the ability to change the property name mapping? Seems to be a trivial thing to do...of course I know nothing about the designers and how you implement those.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search