﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Business Object causing Visual Studio IDE to crash</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:50:46 GMT</lastBuildDate><ttl>20</ttl><item><title>Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9712.aspx</link><description>I have a DLL called CommonBOs.DLL containing over 60 business objects.&amp;nbsp; One of the BOs in that DLL is called PropertyBO.&amp;nbsp; &lt;P&gt;In Visual Studio 2005 SP1, I have a VB2005 StrataFrame project with a form that contains an instance of PropertyBO.&amp;nbsp; Whenever I display the form in design mode the IDE crashes.&lt;/P&gt;&lt;P&gt;I rebuilt and cleaned the project multiple times with the problem continuing to occur.&lt;/P&gt;&lt;P&gt;I started another instance of Visual Studio and attach it to the instance that crashes and sent the debug code to the new instance.&amp;nbsp; I receive the following message.&lt;/P&gt;&lt;P&gt;[quote]System.Reflection.TargetInvocationException was unhandled&lt;BR&gt;Message: Property accessor 'Locked' on object 'PropertyBO1' threw the following exception:'The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.&amp;nbsp; Business object record count: 0.&amp;nbsp; CurrentRowIndex: -1.'[/quote]&lt;/P&gt;&lt;P&gt;I've rebuilt the business objects, recompiled the DLL and replaced the original DLL in the project.&amp;nbsp; If I remove the old and drop the new PropertyBO on the form it causes the same problem.&amp;nbsp; I can reproduce the problem by clicking on the PropertyBO1 instance in design mode.&amp;nbsp; If I drop other BOs from the DLL onto the form no crash occurs.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So far I haven't noticed the IDE crashing unless I'm displaying the form in Design mode.&lt;/P&gt;&lt;P&gt;Any ideas on how to troubleshoot this further?&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Tue, 26 Jun 2007 13:36:40 GMT</pubDate><dc:creator>Michael Cobb</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9806.aspx</link><description>Duh. I forgot about actual properties of the control itself.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
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.</description><pubDate>Tue, 26 Jun 2007 13:36:40 GMT</pubDate><dc:creator>Ben Dornis</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9803.aspx</link><description>Actually, not in this case.&amp;nbsp; The brackets were already in place, and you are right that in most cases this will work, but not this one.&amp;nbsp; In this case, .NET is looking for the Locked property within the designer which is expected to be a Boolean.&amp;nbsp; His was typed as a String which caused the VS environment to crash.&amp;nbsp; Brackets made no difference in this case.</description><pubDate>Tue, 26 Jun 2007 11:18:22 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9802.aspx</link><description>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.</description><pubDate>Tue, 26 Jun 2007 11:07:25 GMT</pubDate><dc:creator>Ben Dornis</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9771.aspx</link><description>Well, you learn something new every day :)&amp;nbsp; Locked is a reserved word used intrinsically within .NET.&amp;nbsp; The reason it fails is due to the compiler running in the background in VB.NET when the property is being reflected.&amp;nbsp; 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.&amp;nbsp; So this is one instance when it may be better to use "LockedValue" or "IsLocked" as your property value.&lt;/P&gt;&lt;P&gt;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.</description><pubDate>Mon, 25 Jun 2007 09:09:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9757.aspx</link><description>Yes, I have attached a zip file with the solution.&amp;nbsp; You'll see that it contains CustomersBO.&amp;nbsp; This is generated through the Business Object Mapper against the SF Sample Database Customers table with the additional column Locked as described in previous posts.&amp;nbsp; To reproduce the IDE crash,&amp;nbsp;add a new SF Maintenance form.&amp;nbsp; After the form is added, drop the CustomersBO object on it.&amp;nbsp; If the IDE doesn't immediately crash, try clicking the CustomersBO1 that was added to the form.&amp;nbsp; The IDE should crash.&amp;nbsp; The way I found the reflection error that I posted earlier was by starting another instance of the VS IDE attaching to the VS IDE process containing the LockedTest solution.&amp;nbsp; If you click the Debug button when the VS IDE with LockedTest crashes, the IDE with the attached process will capture the exception detail.&amp;nbsp; Then you can hit Continue and the IDE that had LockedTest will finish crashing.&amp;nbsp; Thanks for looking at this and let me know if you have any questions.</description><pubDate>Fri, 22 Jun 2007 15:09:59 GMT</pubDate><dc:creator>Michael Cobb</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9756.aspx</link><description>Can you supply a sample versus us going back and forth over the forum?&amp;nbsp; It would probably speed things up.&amp;nbsp; Thanks. :)</description><pubDate>Fri, 22 Jun 2007 14:20:23 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9755.aspx</link><description>I understand what you are saying but this is just a generated BO with no additional code being dropped on a brand new SF Maintenance Form that contains only SF generated code itself.&amp;nbsp; I'm not using any custom control other than SF controls and there is no custom code in the BO in order to perform a data read.&amp;nbsp; If I simply change the name of the column I created in verification Step 2 in my previous post, the IDE does not crash.&amp;nbsp; If I change it back, the IDE crashes.&amp;nbsp; In each case, the steps I go through are identical.&lt;P&gt;To give you some more detail, the steps I took to recreate this are exactly the same as in your tutorial with the only difference being that I added a column called Locked (when the IDE crashes) and&amp;nbsp;LockedTst (when it doesn't crash)&amp;nbsp;to the Customers table in the StrataFrame sample database before beginning Tutorial_Win_VB_2 (Adding a Business Object).&amp;nbsp; I am able to successfully complete this tutorial with no problems.&amp;nbsp; I skipped Tutorial_Win_VB_3 and resumed at the beginning of Tutorial_Win_VB_4 (Adding a Form) using the same project.&amp;nbsp; When I begin Tutorial_Win_VB_5 (Adding Controls &amp;amp; Binding Data) with the same project and get to Step 3, as soon as I drop the CustomersBO item on the CustomerMaintenance form, the IDE crashes.&lt;/P&gt;&lt;P&gt;This is why I based my assumption that the problem must be related to something in SF-- you should be able to reproduce it there as well.&amp;nbsp; Would you be willing to try adding a column called Locked to your Customers table and run through your tutorials as I did? &lt;P&gt;If you weren't able to reproduce it at your end I would be surprised.&amp;nbsp; &lt;P&gt;Thanks!</description><pubDate>Fri, 22 Jun 2007 14:03:28 GMT</pubDate><dc:creator>Michael Cobb</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9749.aspx</link><description>[quote]Any ideas why having a column called Locked is a problem?&amp;nbsp;[/quote]&lt;P&gt;If you create a column with a different name does the error persist?&amp;nbsp; I think it will.&amp;nbsp; I don't think that the column name Locked is your problem.&lt;/P&gt;&lt;P&gt;The error message that you are getting indicates that it is trying to read from the table, which at design time, has no data within it.&amp;nbsp; If you have created a custom control or something that is firing a New() or constructor code in the designer then you will need to test on whether you are in design mode or not....otherwise this error will always appear.&lt;/P&gt;&lt;P&gt;The message just indicates that the Get is being fired and CurrentRowIndex and CurrentRow does not actually represent any data.&amp;nbsp; So you need to see where the Locked property is trying to be read and then you should be able to work backwards.&lt;/P&gt;&lt;P&gt;FYI....to test on design mode use the DesignMode property of the user control or form you are working on:&lt;/P&gt;&lt;P&gt;[codesnippet]If Not MyForm.DesignMode Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Place your code here&lt;BR&gt;End If[/codesnippet]&lt;P&gt;[quote]Are there other column names that cannot be used in conjunction with StrataFrame Business Objects?[/quote]&lt;P&gt;This has nothing to do with SF but rather .NET....and you can name a column pretty much anything you want...including reserved words or types in most cases, such as Type.&amp;nbsp; I could create a property named type and just make sure that in VB.NET it is surrounded with square brackets or preceeded with an @ symbol in C#.&lt;P&gt;[codesnippet]Public Property [Type] As System.Type&lt;BR&gt;&amp;nbsp; '----&lt;BR&gt;End Property[/codesnippet]</description><pubDate>Fri, 22 Jun 2007 12:56:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object causing Visual Studio IDE to crash</title><link>http://forum.strataframe.net/FindPost9745.aspx</link><description>I have identified the cause of the issue.&amp;nbsp; I have a column called Locked(varchar(1), null) in the Property table that the PropertyBO is based on.&amp;nbsp; The steps I took to identify it were as follows:&lt;P&gt;1) Removed all references to the Locked property in the PropertyBO.vb and Property.designer.vb files.&amp;nbsp; Recompiled the CommonBOs.DLL file.&amp;nbsp; Replaced the reference to CommonBOs.DLL in my StrataFrame project with a reference to the new version.&amp;nbsp; Dropped an instance of PropertyBO on my form.&amp;nbsp; No IDE crash.&lt;/P&gt;&lt;P&gt;2) Added a column called Locked(varchar(1), null) to the Customers table in the StrataFrame sample database.&amp;nbsp; Used the Business Object Mapper to generate the updated partial class.&amp;nbsp; Created a new test project and added the new version of&amp;nbsp;CustomersBO to the project.&amp;nbsp; Created a new StrataFrame maintenance form.&amp;nbsp; Dropped an instance of CustomersBO on the form.&amp;nbsp; The IDE crashes.&amp;nbsp; As before, I trapped the error in another instance of Visual Studio and verified that it was the same error as in my original post.&lt;/P&gt;&lt;P&gt;Any ideas why having a column called Locked is a problem?&amp;nbsp; I'm assuming that this is because Locked is a property in a different namespace used in my project.&amp;nbsp; Would there be any way to work around this short of renaming the column in the database or manually modifying the partial class?&amp;nbsp; Are there other column names that cannot be used in conjunction with StrataFrame Business Objects?&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Fri, 22 Jun 2007 12:22:39 GMT</pubDate><dc:creator>Michael Cobb</dc:creator></item></channel></rss>