• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

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

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?
0
lefodnes
Asked:
lefodnes
  • 2
1 Solution
 
karl-henrikCommented:
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
//Karl-Henrik.
0
 
lefodnesAuthor Commented:
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.
0
 
lefodnesAuthor Commented:
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.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now