473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.
Oct 7 '08 #1
3 11112
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" <je*******@hotmail.comwrote in message
news:f0**********************************@i76g2000 hsf.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.
Oct 7 '08 #2
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
Oct 8 '08 #3
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" <je*******@hotmail.comwrote in message
news:f4**********************************@t42g2000 hsg.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
Oct 9 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Johnny Meredith | last post by:
Warning: Tenderfoot I'm playing around with ASP.Net 2.0 b2. The web app I've created has a default, login, recovery, etc. pages in the root and two folders accessible to authenticated users...
5
by: farmer | last post by:
I need "include" multiple classes from multiple files such as: <%@ Page Language="C#" Debug="true" ValidateRequest="false" Src="~/Auth/Pub/Auth.cs"%> <%@ Page Language="C#" Debug="true"...
0
by: GS | last post by:
Is dataset template added to App_Code any usefull for you? If yes, the how? G
1
by: Alexander Walker | last post by:
Hello I have recently published a web application using the "Publish Web Site" option of the solution explorer from Visual Studio 2005, I have published the website so that the pages could not...
29
by: jens Jensen | last post by:
Hello, I got this "breath taking" task to write a an http server to which "xml data" will be posted to and will answer with xml data. The logic behind the xml processing is not a matter here. ...
2
by: Alex Maghen | last post by:
It seems like, the way ASP.NET 2.0 works, I should be able to build a pre-compiled version of my site so that none of the code of the site would be accessible by the people for whom I developed it....
5
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I'm developing a service which is two sites: a Mobile Site and a PC-Based Site. The whole goal is to have them operate very similarly but, of course, there will be many differences: 1....
1
by: Brian Simmons | last post by:
Hi All, I know that if you modify the web.config file or any file in the App_Code subfolder, that ASP.net 2.0 will "restart" the application (i.e. clear out any sessions, etc...). Are there...
2
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I want to be able to place ASP.NET applications inside each other (nested). The idea would be that I want to be able to have a docroot that contains the normal Web.config and App_Code directory,...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.