开发者

How to easily include common code across multiple ASP.NET MVC sites

At work we have about 30 legacy sites which run from a common set of code, currently these sites are in cold fusion. For this common code we have one project, then in IIS we set up a virtual directory to include the common code into each site. This works great, as changes to core logic can be made in one place, and its replicated through all the sites. And as all of our sites are hosted on the same servers, we can also just deploy the common code and all the live s开发者_开发技巧ites are updated, we don't need to release every site.

However we are in the process of re-writing our sites and core code into c# and asp.net MVC 3. Its going well, except when we update the core code, we are currently copying the dlls into each site, recompiling, then releasing each site.

This is fine while we only have a couple of sites re-built with the core code, but is going to be very painful when all 30 of our sites have been re-built in .net.

Does anyone have any ideas of how to easily use and delpoy common code without having to copy the dlls to every site?

So far we've tried: - using a virtual directory of the dlls (doesn't work as site code needs to be re-compiled, and IIS doesn't seem to like it on .net sites anyway) - deploying our common dlls to the GAC - this is an issue as the third party libraries (eg nHibernate) aren't signed, so can't add them to the GAC too.

Thanks

Saan


The easiest way is to automate your update procedure. But if you want to rid of copying at all then you can try thing named "codebase". Here is description of "How the Runtime Locates Assemblies" and details of "Locating the Assembly through Codebases or Probing" http://msdn.microsoft.com/en-us/library/15hyw9x3(v=vs.71).aspx


Interesting.

I also saw in the next .net relase they have http://www.asp.net/vnext/whats-new#_Toc_perf_3 “Sharing Common Assemblies”

This will give us a couple of options to investigate thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜