唯一需要注意的是,无论何时更新共享代码项目,您都必须将新的.DLL重新分发给使用它的所有网站。 另一种方法,就是写网络服务。执行常见任务, 和您的各种网站可以使用中央网络服务。 matt Hello All,I found that ASP.net website only accepts code withing site directory.This creates big hurdle in shairng code. How to share code between twowebsites, like the way share between two non-website code?-Pravin 解决方案yes, you need to write your shared code into "class libraries"projects, which are then compiled into .DLL assemblies. you thendistribute copies of these DLLs to the /bin folders of any otherwebsite that youd like to make use of the shared code.only caveat is, any time you update the shared-code project(s), youmust re-distribute the new .DLL to all the websites that use it.another approach, is to write "web services" that perform common tasks,and your various websites can consume the central webservice.mattyes, you need to write your shared code into "class libraries"projects, which are then compiled into .DLL assemblies. you thendistribute copies of these DLLs to the /bin folders of any otherwebsite that youd like to make use of the shared code.only caveat is, any time you update the shared-code project(s), youmust re-distribute the new .DLL to all the websites that use it.another approach, is to write "web services" that perform common tasks,and your various websites can consume the central webservice.matt 这篇关于如何在两个不同的网站之间共享代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 17:24