BO default properties


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K

Hi Trent,

Ok - the problem I have is that when I create my base class as a Windows class (TMS_Test_01.boBase02) I get the following error in my SF BO's that inherit from it. There is no Designer file for TMS_Test_01.boBase02 and this made me think that maybe it should have been created using the SF Business Object template.

All my classes are in a single Solution so I can't see that it can be a referencing issue and the solution has been cleaned/rebuild many times.

My class starts with the code:

Imports System.Data

Imports System.Data.SqlClient

Imports System.Runtime.Serialization

Public Class boBase02

Inherits MicroFour.StrataFrame.Business.BusinessLayer

Cheers, Peter

>>>>>>>>>>>>>>>>>>>>>>
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: boAGT2 --- The base class 'TMS_Test_01.boBase02' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
   

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Here is a custom BO class that is inherited from the SF business layer.  I have just created this, tested it, created a new BO, and mapped to it and it works as advertised BigGrin

Public Class MyCustomBO
    Inherits MicroFour.StrataFrame.Business.BusinessLayer
#Region " Constructors "
    Public Sub New(ByVal Container As System.ComponentModel.IContainer)
        MyBase.New(Container)
    End Sub
    Public Sub New()
        MyBase.New()
    End Sub
    Public Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
        MyBase.New(info, context)
    End Sub
#End Region
End Class

Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

Thanks for the very prompt response. I've used your code and I still have the same problem - but at least I now know that part of the puzzle is according to Hoyle so I can now try and track down the problem in other areas.

Cheers, Peter

Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

Maybe something has can astray in my environment. Here is what I have just done:


1. Created a Windows class, called it boBase03 and copied in your code and changed the classes internal name to boBase03.

2. Did a rebuild.

2. Created a new BO (BusinessObject2) and mapped it to a simple table and did a partial rebuild with the new BO.

3. Opening up the new BO in the IDE and no problems - could toggle ok between the BusinessObject2.vb and BusinessObject2.vb[Design] tabs. Also opened its Designer file - no problems.

4. Did a rebuild.

5. Opened my new BO and changed the inherits line to: Inherits TMS_Test_01.boBase03

6. Did a rebuild.

7. Click on the BussinessObject2.vb[Design] tab in the IDE and received the following error (same as before).

8. Changes the inheritance back to: Inherits MicroFour.StrataFrame.Business.BusinessLayer.

9. Did a rebuild.

10. Everything is ok.

11. Closed all tabs.

12. Opened BusinessObject02 and changed the inheritance back to: Inherits TMS_Test_01.boBase03

13. Clicked the BusinessObject2.vb[Design] and tab and again the same error appears.


Trent, what I did notice is that my standard (base BO - "boBase03") Windows class that now contains the code you provided also appears in the BO Mapper with the red (must be configured) cross symbol. I didn't do anything with it in BO Mapper but is this expected?

I will try repeating these tests in a new Solution.

Cheers, Peter


>>>>>>>>>>>>>>>>
The designer could not be shown for this file because none of the classes within it can be designed. The

designer inspected the following classes in the file: BusinessObject2 --- The base class 'TMS_Test_01.boBase03'

could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Hide    

at

System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager

manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager

manager)
at

Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationM

anager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
>>>>>>>>>>>>>>>>>>>

Peter Jones
Peter Jones
Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)Advanced StrataFrame User (520 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

Well doing the same as above in new Solution works just fine so I will leave that apparently corrupted Solution behind and move on. However I would appreciate some feedback on my "base bo" appearing in the BO Mapper (this also happens in my new Solution). Is this to be expected? Should I just ignore it?

Cheers, Peter

StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Peter,

The base bo is going to appear in the business object mapper... I don't think there's a way around that.  However, you can add the <HideFromExtensibility()> attribute to the top of your class to keep it from showing up in other places, like the PopulationDataSourceSettings editors, and things like that.

As for why your other should could not be designed... that's a VS thing.  When you add a new component to your solution, sometimes, the type will not be available to the VS type resolution service until you close VS and reopen it.  So, the next time you add a new base bo class: add it, build your solution, close VS, and reopen VS and you should be alright.  It's the same problem that occurs when you add a new control or business object and try to drop it from the toolbox immediately after building; sometimes it works fine, but sometimes VS gives you the error saying that the type "classname" instantiation failed and that it will be removed from the toolbox.  Same silly issue, just close VS and reopen it.

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