StrataFrame Forum

Referencing BO project DLL's from website in solution

http://forum.strataframe.net/Topic5452.aspx

By Rusty Martin - 12/22/2006

I seem to remember in a web solution demonstration that I saw, that you kept copying the DLL’s for the referenced BO project from the BO project to the website project each time he made a change to the BO’s and built them. It seems to me that the right way is to reference the BO project from the web project but each time it tries to get the new copy of the DLL from the BO project, I get an Access Denied error and I have to manually delete (using the file system) and then manually copy the files to the right bin folder to get the reference to update.

Am I correct to reference the BO project or is copying them manually the right way to update the reference when needed?

By Charles Thomas Blankenship - 12/27/2006

Hi Rusty:

Are you running the application in debug mode through Visual Studio?  If so, check for a little Icon down in the lower right hand side of the status bar.  It is a web server that is running under VS and it will take hold of your dll stoping an automatic copy on rebuild.  Before you build, right click on this little icon and select stop.  Then rebuild ... the BO dll should then be copied into the web app's bin folder.

Ben helped me fix this little problem last week ... I hope it will do the same for you.  As for me, it saved a ton of aggrevation and time ... thanks Ben.

Best and happy holidays,

CTBlankenship

By Keith Chisarik - 12/27/2006

I have not been able to get around manually copying the BO project DLL's into the bin folder of the web project when I make changes. Gonna watch this thread to see the resolution, good topic.
By StrataFrame Team - 1/2/2007

If you reference the DLL on disk, you will have to manually copy the file each time the business objects change.  If you reference the BOLibrary project, then VS will automatically take care of building and copying the DLL to the \bin directory.  However, like CT said, if you are running the website from within VS, manually copying the DLL can only be done when the development server is stopped (which doesn't happen when you stop a debug in VS... it only happens when you right-click the server icon in your systray and click "Stop").  Obviously, when you publish your website, this information changes... the DLL always has to be copied out to the \bin folder on the webserver, and I'm not sure if VS will copy it out there automatically or not.
By Guillermo Vilas - 1/16/2007

Hi

The scenario described above occurs when a developer select to create a web project from the system file option.

When you select to create the web project the old way (http://localhost) there is no icon running a virtual host, thou there's no need to recopy the dll been referenced as Visual Studio will take care of that.
By StrataFrame Team - 1/16/2007

Hrm... that's a good point... if you open the website from the file system, VS uses the development ASP.NET server, otherwise, it just uses the server through which you opened the site.
By Guillermo Vilas - 1/18/2007

Also this is a good chance to include that if the web project is not going to be a huge one, there is no need to create a BO project. You can add a class file into the App_Code folder and then inherit from MicroFour.StrataFrame.Business.BusinessLayer.



eg:1)



App_Code

- MyClass.vb or MyClass.css

- MyClass.Designer.vb or MyClass.Designer.cs



2) Add an existing BO Component from another project to the App_Code



for me both options works
By StrataFrame Team - 1/18/2007

Yes, that will work, however, not all functionality of the BOMapper works with a Web Site, and you cannot get to the component designer for the business object, so you have to set all of the properties programmatically.  So if you cannot rebuild the partial classes of your business object, or you want the component designer, then you'll have to put the BOs in a DLL or convert the web site to a web project.