Reputation:
We have several VB.NET websites running internal applications. These sites are often modified with minor changes, and are maintained on the server as uncompiled code.
I'm looking for the best way to maintain classes so that we can reference them from multiple websites. Specifically, we're looking to put some common functions (error logging, common database calls, etc.) into a centralized location where they can be maintained separately from the sites and called as needed. And we'd prefer to have this on the server as uncompiled code, so it can be uploaded without precompiling.
I feel like I'm missing something obvious, but what is the best way to set this up?
Upvotes: 0
Views: 280
Reputation:
One approach I've found to this is to use symbolic links. Specifically with the 'fsutil hardlink' command, I can create a hard link in the App_Code directory of each application that points to the common class file. Then it can be referenced in the code as though it is local to each application.
Upvotes: 0
Reputation: 1653
We use source control (spec. SVN) for this kind of stuff. Set the common stuff up as external references then any updates to them will be shared to the specific websites. No branching is required.
Upvotes: 0
Reputation: 7844
Depends on how your websites are hosted.
If you're using a hosting provider (like godaddy.com), you could call methods from the class via a web service.
Or if all the websites are on the same machine you could drop your DLL into the GAC and reference from there.
Upvotes: 1