Brad
Brad

Reputation: 3591

C# shared code across multiple websites by moving code up a folder outside website

I have 3 differnt websites on same webserver under a root directory. A lot of the code is the same across all 3 websites.

I wanted to see if there was a way to move code from all 3 websites up one level (outside the website itself) to the root directory (where the folders for each website are contained.

EX. The root directory is c:\ (where i want to move the files to and access from each indivual website. The websites themselves are contained in c:\Website1, c:\Website2, etc.

So is it possible to move code from c:\Website1 to c:\ and access it from c:\ in the c:\Website1 website?

If you need more details or I am not clear let me know.

Thank You.

Upvotes: 1

Views: 449

Answers (2)

Paul Williams
Paul Williams

Reputation: 17020

I recommend putting the library DLL in the GAC.

Consider this: what if you need to update the library DLL to support new features for one site, but this introduces incompatibilities with the other sites? The GAC supports multiple versions of the same assembly, so you can update the web sites separately, if desired.

Upvotes: 2

Anthony Nichols
Anthony Nichols

Reputation: 1668

Depending on what you are trying to accomplish placing them inside of a dll may make since. I would advice placing those in folder: c:\libs\ and then you could access it via: ..\libs\

Upvotes: 0

Related Questions