473,699 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Share app_code between multiple virtual directories

I would like to share code between several web sites that exist as virtual
directories under a single site. It appears that I have to create an
app_code directory under each virtual root in order to share classes accross
the code in the different virtual directories.

This seems to defeat the purpose of shared code.

Is there any way to specify to IIS where the app_code directory is for a
virtual site?

Thanks for the help
Jan 26 '06 #1
3 3140
I don't think the purpose of app_code is to share code but rather provide a
place where the server monitors for changes and recompiles on the fly.

Just share the code the code old fashion way by creating a separate library
project and giving each virtual root a copy of that assembly.

"Bob Peek" <Bo*****@discus sions.microsoft .com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
I would like to share code between several web sites that exist as virtual
directories under a single site. It appears that I have to create an
app_code directory under each virtual root in order to share classes
accross
the code in the different virtual directories.

This seems to defeat the purpose of shared code.

Is there any way to specify to IIS where the app_code directory is for a
virtual site?

Thanks for the help

Jan 26 '06 #2
Regardless of the purpose of the app_code directory, my goal is to share code
accross multiple virtual directories. While your approach will probably
work, it seems to me that the concept of inheriting classes and re-usable
code is defeated by the rather strict constraint that code must reside in a
specific directory with no provisions for pointing the application to a
directory that could contain code common to multiple web sites.

Thanks for you help, I will try your approach
Jan 27 '06 #3
The purpose of the App_Code directory is for ASP.NET to directly compile
your website (singular) classes together with your ASPX pages for that
website (singular). It is to share classes among your website.

What you want to do requires that you build a common DLL and either deposit
it into your bin directory for each website or put it in the GAC.

This is the purpose of shared code. The question is if you are sharing
within the right context.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Bob Peek" <Bo*****@discus sions.microsoft .com> wrote in message
news:F9******** *************** ***********@mic rosoft.com...
I would like to share code between several web sites that exist as virtual
directories under a single site. It appears that I have to create an
app_code directory under each virtual root in order to share classes
accross
the code in the different virtual directories.

This seems to defeat the purpose of shared code.

Is there any way to specify to IIS where the app_code directory is for a
virtual site?

Thanks for the help

Jan 27 '06 #4

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

Similar topics

2
2200
by: Greg W. | last post by:
In our setup project, we have the standard web application folder, but we also have 4 web custom folders (virtual directories) that are created at the same level as the web application folder (i.e. not subdirectories). The setup works fine as long as the user leaves the default setting of port 80. If they choose something different, the install program loads the web application folder correctly at the non-standard port, but it installs...
1
1199
by: Paul Hodgson | last post by:
Is there any easy way to have .ascx controls used by pages in different virtual directories? My situation is that I have some pages that need to be accessed using SSL - so I've put these pages in a separate virtual directory that is set up in IIS to require secure access. Trouble is however that these pages need to use some of the same .ascx controls that my non-secure pages need (and which are therefore located in the root directory,...
5
1651
by: Sammy | last post by:
On a Windows 2003 Server machine that has multiple IIS web sites, how does one control which web site the new web application gets created under? Thank you, Sammy
3
1501
by: dph | last post by:
I have an asp.net application that I need to run from multiple different virtual directories. However, I don't want simply copy an instance of the application into each of these directories as that would be a maintenance nightmare. Also, each of these directories will need to have a separate copy of the web.config. I was hoping it would be as simple as a Server.Execute in a default page within each virtual directory that loaded the...
11
29861
by: Steve Franks | last post by:
I'm using VS.NET 2005 Beta 2. I have a helper C# class I wrote that I placed in my /App_Code directory. Everything runs fine locally. However when I use the "Copy Web" function to upload the site to the production server, I get the following error when trying to run the page on production: "System.Web.HttpException: The directory '/App_Code' is not allowed because the application is precompiled." Anyone know this works fine locally but...
27
1827
by: Smithers | last post by:
Until now I have worked on small teams (1-3 developers) and we've been able to stay out of each others way. Now I'm about to start work on a project that will have 5 developers. I would appreciate some guidance on how we can proceed to develop without having to worry about "who is working on what files". We're developing with SQL Server 2005, VS 2005 Pro (no way management is going to spring for the $10,000 team edition for everybody),...
1
2160
by: dotnetmuddu | last post by:
Hi, Have you guys come across this ? Can I share the session state between virtual directories. Ex : I have Virtual Dir SessionTest1 & SessionTest2. If a variable Session = "testuser" which is in WebForm1.aspx.cs of SessionTest1 Project be accessible at SessionTest2's WebForm1.aspx.cs Please reply if any one of you have got the answer for this Questions.
3
5560
by: bissatch | last post by:
Hi, I have been using the following tutorials: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/pages/code.aspx It would appear that it is instructing me to simply to create an App_Code folder and place the CustomClass.vb file there. I have done so and using the exact same code from the tutorial but it tells me the class is undefined:
1
1863
by: Frank Miverk | last post by:
Hi, I have a situation which I think is fairly common. 1. Public area 2. Secure area accessed via SSL e.g. MyWebsite/ /MySecureWebsite
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7750
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.