How can I have .cs files another folder than in the App_Code folder of an website?

Posted on 2011-10-12
Last Modified: 2012-05-12
I would like to share a couple files between multiple web sites running on one server. The files are typical files that reside in the App_Code folder, but now, whenever I do a change in one of the App_Code files, I must copy them to the other web sites. I want to have every website look for and compile the file from a common folder outside the web site folder. Each website project should then somehow link to that folder or file, maybe from the web.config or something. How can I do this?
Question by:lefodnes
    LVL 3

    Accepted Solution

    I would create a ClassLibrary for the sites and then add a reference from the Websites to the ClassLibrary.

    See here for reference

    Hope that helps

    Author Closing Comment

    Thank you for the suggestion and the link. It was not exactly how I wanted it, I really need a way of not having the cs files only in the App_Code-folder. I like to collect the files with other files in folders with related functions.

    Author Comment

    Sorry, last post was submitted before I got it edited correctly.
    Your solution was not exactly how I wanted it, but that might not even be possible. But your solution will work with a few changes in the code. Thank you for your support.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now