How to use BOs from Win project within a Web project


Author
Message
Larry Tucker
Larry Tucker
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Hi,

I've been working on a SF Windows project and would now like to build my first SF Web project that uses the same business objects.  I've read the SF Tutorial several times but cannot quite get it to work.

First, can I leave the BO's within the Win solution, or do I need to pull them out as a separate BO library?  I'd prefer to just leave them in the Win project and manage them there.  If this is possible, how do I reference them from the Web project?

On the assumption that I need to pull them out as a separate BO Library (like the Tutorial), I tried this before posting this question.  When I go to add a reference to the new BOL from either the Win or Web solutions, the Add Reference / Project folder is empty (unlike the Tutorial!). 

So I'm stuck at step one of my first SF Web project and must be missing something basic. 

TIA,

Larry

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
First, can I leave the BO's within the Win solution, or do I need to pull them out as a separate BO library?

Really these shouldn't be in the Win solution either.  They should be in a separate BO class library.  You can move them into one easily, but you should really place your BOs in a separate BO library.

Though a Win EXE is a .NET assembly and you could load it if you really had to, you shouldn't do this as you will have some permission issues on the web side.  You need to first place your BOs in a BO library, then you Win and Web forms projects will reference the same BO library.

When you do this, you will want to use a solution, not just a project.  When you do this, you can use a project reference and it will appear.  If you do not want to do it that way (which is the recommended approach), then you can just browse for the BO library assembly and add it as a reference from disk.

Larry Tucker
Larry Tucker
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

You need to first place your BOs in a BO library, then your Win and Web forms projects will reference the same BO library.... When you do this, you will want to use a solution, not just a project.  When you do this, you can use a project reference and it will appear. 

Thanks for the quick reply, especially on a Sunday.  I'm trying to do this, and as far as I can tell, am doing the same steps as the Tutorial,  but when I get to the Add Reference / Project tab, my BO library is not visible to be selected.  In fact, no projects are shown in this tab at all.

Is there anything that I need to do to make a project available or visible to others?  It seems odd that my Add Reference / Projects tab is completely blank, even though I've created several test SF projects of various sorts.

PS:  I've attached a jpg of the step in the Tutorial where I am stuck... FWIW.

Larry

Attachments
TutorialScreenShot.jpg (126 views, 108.00 KB)
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
I have attached a sample VS2005 project that has a WinForms project and a BO library.  The WinForms project references the BO library as a project reference.

Larry, if you could work it out, I think that the training class coming up in July would be really good for you.  We cover a lot of material and have an entire section just on application layout, etc.  If you could make it happen I think that it would be well worth your while.  Just an idea Smile

Thanks for the quick reply, especially on a Sunday. 

No problem.  I am working and happened to be online when I saw your post. Smile

Attachments
TuckerProjectLayoutSample.zip (112 views, 73.00 KB)
Larry Tucker
Larry Tucker
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

Thanks for the sample.  I think my problem is with using the IDE.  I understand how to build a BOL and how to build a Win app... I just can't get them together.  How did you add the BO Library to the Win project?  On your example, the Win project has a "Solution" folder at the very top and when I click Add Reference / Project... I see a choice.  On mine, the Solution explorer starts with the VBproject and has no overall "Solution" folder at the top of the tree.  When I right click on my project to add a BO reference, it is empty.

Otherwise, what you sent me looks just like what I've been trying to do. I don't seem to be able to create a "Solution" as opposed to a "Project".   I'll poke around for a while more on my own, as this is not really a SF issue...

As for the training class, I'd love to come... except I'll be biking in the Loire Valley BigGrin.  I'm actually making good progress within my SF Windows project.  I feel like once I'm over this hump, I'll be rolling again (if I don't shoot myself firstCrying ).

Larry

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
Otherwise, what you sent me looks just like what I've been trying to do. I don't seem to be able to create a "Solution" as opposed to a "Project".   I'll poke around for a while more on my own, as this is not really a SF issue...

This is an option in the IDE.  Click Tools->Options... then click the Projects and Solutions option on the left.  Once done, click the Always Show Solution option.  This will always force a solution to exist.

Larry Tucker
Larry Tucker
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Doh!  Problem solved.  It was a VS IDE use issue for me.  I hadn't worked with mulit-project "solutions" before and now see how to do this. 

Before you can add a reference to ProjectB within ProjectA, you need to add ProjectB to ProjectA.    Oddly, the way you do this is not within the Solution Explorer but over on the File/Add/Existing Project menu.  Right clicking within the Solution Explorer only offers to add items (not projects) when you have only a single project.

Once I added my BOL project to my WinForms project with this choice, I now had a "solution" with two projects and a top level "Solution" folder.   Now right clicking my Winform project and pulling up the Add Reference / Project screen shows my BOL project and I can add the reference.   Apparently a project has to be in a solution in order to show up in the Add Reference / Project tab.

Boy, that was a head banger for a while...

Thanks for the help Trent.

Larry

Larry Tucker
Larry Tucker
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

this is an option in the IDE.  Click Tools->Options... then click the Projects and Solutions option on the left.  Once done, click the Always Show Solution option.  This will always force a solution to exist.

Your reply came while I was stumbling on my own version of a solution.

Thanks again.

L

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
Glad you got it going Smile
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