Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 7 Oct 2008 08:38:02 -0700 (PDT),    group: microsoft.public.dotnet.framework.aspnet        back       


Convert "App_Code" to DLL ?   
Hi guys,

I have inherited a .NET 2.0 web project. It consists of a root site,
and 3 sub directories.

Ideally these are seperate projects/websites. The root is a customer-
facing one, and the other 3 are for admin, and supervisor use.

I want to break the existing project (all websites treated as one)
into 4 separate websites.

Unfortunately they all share the "App_code" directory, which contains
common classes to all 4 sites.

Can anyone advise on how I can make the App_code a shared component in
4 websites, so that I can rebuild the entire app as 4 projects, which
will speed up development, and make it more robust (90% of development
and fixes go into the public site, why rebuild the other 3 every
time ?

Thanks in advance, guys.
date: Tue, 7 Oct 2008 08:38:02 -0700 (PDT)   author:   Jethro

Re: Convert "App_Code" to DLL ?   
Create a new class library project (in the appropriate language) and copy 
the App_Code files into that project. Run it until you can compile, as there 
may be some web libs you need to reference, esp. if there is not a good 
separation of concerns (likely considering you have library material in 
App_Code).

After it compiles, take one of the websites and exclude everything in the 
App_Code folder that you have moved. Make a reference to the new library.

Now go through and correct the using (C#) or Imports (vb) statements for 
your project. Once you have a compile, consider it a test build and have 
someone from QA (if you have QA) test that build thoroughly. Consider it 
suspect, because someone may have tied in some config elements that are not 
pulling properly into the lib, etc.

As it is being tested, go to another site and do the same. Rinse and repeat 
until all sites are thoroughly clean and tested. Then, go back and delete 
the excluded files.

NOTE: If you are using source control (you are, right), you can branch the 
build before doing the switcheroo and delete instead of exclude at the first 
step. It is unlikely you are going back. But, if you are, you still have the 
old branch to go back to.

-- 
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box!                               |
********************************************
"Jethro"  wrote in message 
news:f0462e4a-daf2-4f7d-8293-ae1831f89622@i76g2000hsf.googlegroups.com...
> Hi guys,
>
> I have inherited a .NET 2.0 web project. It consists of a root site,
> and 3 sub directories.
>
> Ideally these are seperate projects/websites. The root is a customer-
> facing one, and the other 3 are for admin, and supervisor use.
>
> I want to break the existing project (all websites treated as one)
> into 4 separate websites.
>
> Unfortunately they all share the "App_code" directory, which contains
> common classes to all 4 sites.
>
> Can anyone advise on how I can make the App_code a shared component in
> 4 websites, so that I can rebuild the entire app as 4 projects, which
> will speed up development, and make it more robust (90% of development
> and fixes go into the public site, why rebuild the other 3 every
> time ?
>
> Thanks in advance, guys.
date: Tue, 7 Oct 2008 13:12:36 -0500   author:   Cowboy \(Gregory A. Beamer\) oSpamM

Re: Convert "App_Code" to DLL ?   
Thanks a million, it worked ! Great !! almost there. One last
question ...

One of the main apps files was "Webservice.asmx" which contained only
the following line :

<%@ WebService Language="VB" CodeBehind="App_Code/WebService.vb"
Class="WebService" %>

now as it happens it's only the Main app which uses this file, so
there's no issue with putting it back into App_Code, and letting the
thing build, However, as an academic excercise, is there a way to
redirect it to look in my shiny new DLL ?

thanks in advance
date: Wed, 8 Oct 2008 11:44:54 -0700 (PDT)   author:   Jethro

Re: Convert "App_Code" to DLL ?   
Yes.

Do this. Run a publish of a site, clicking the first three checkboxes (not 
100% sure the last part is necessary, but that is how I have it set). Then 
examine the ASMX file. When you publish it changes the directive to look at 
the DLL instead of a code file. Use the example as a cheat sheet to do what 
you desire.

-- 
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box!                               |
********************************************
"Jethro"  wrote in message 
news:f45152c6-255f-40ee-b691-f60ef878ea48@t42g2000hsg.googlegroups.com...
> Thanks a million, it worked ! Great !! almost there. One last
> question ...
>
> One of the main apps files was "Webservice.asmx" which contained only
> the following line :
>
> <%@ WebService Language="VB" CodeBehind="App_Code/WebService.vb"
> Class="WebService" %>
>
> now as it happens it's only the Main app which uses this file, so
> there's no issue with putting it back into App_Code, and letting the
> thing build, However, as an academic excercise, is there a way to
> redirect it to look in my shiny new DLL ?
>
> thanks in advance
date: Thu, 9 Oct 2008 08:35:55 -0500   author:   Cowboy \(Gregory A. Beamer\) oSpamM

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us