各位高手:
我在开发asp.net网站时发现,web.config在子目录下不知为何根本不执行指定功能,例如下面的一个大文件上传进度组件(我不需要让网站的所有http上传请求都执行该功能):
......
<httpModules>
<add name="HttpUploadEngine" type="UploadEngine.UploadModule, UploadEngine" />
</httpModules>
......
若在IIS中为该子目录添加应用程序名,则需要额外拷贝所有有关的dll(包括网站应用程序本身的dll)到该子目录新建的bin目录下,方可执行。但我觉得这样破坏了web应用程序的完整性,不知各位大侠可否指点一二,有什么好的解决办法。

解决方案 »

  1.   

    according to the documentation:"....
    Not valid in application child directories
       Because they apply to an entire application, the authentication, httpModules, sessionState, and trust configuration elements are excluded from child directories of applications. That is, they are restricted to the Machine.config file and to the Web.config file at the Web site and the application levels only. You can use the allowDefinition attribute to restrict a configuration section to the Web.config file.
    ...."try to add additional entries in your web.config and have your module to check those entries and include/exclude certain directories
      

  2.   

    则需要额外拷贝所有有关的dll直接在引用里面添加,运行时候程序会自动拷贝过去?
    我觉得这样破坏了web应用程序的完整性
    这什么意思?
      

  3.   

    http://blog.csdn.net/jamex/articles/473691.aspx
      

  4.   

    回复 yichuan1982(亦川——四川新津) :
    “直接在引用里面添加,运行时候程序会自动拷贝过去?”
    -不行,不能引用它本身。
    “我觉得这样破坏了web应用程序的完整性”
    -例如session对象不能共享了。reply saucer(思归) :
    "...try to add additional entries in your web.config and have your module to check those entries and include/exclude certain directories..."
    Thank you, greate idea!
    My next question is, how to read self-define web.config entries in ASP.NET (some XML parser?). Thank you again.