The foundation is the heavy weight-assembly auto-load under the site Bin directory

Source: Internet
Author: User

Back to Catalog

The Assembly of the site Bin directory is generally composed of system projects, project references external DLLs and plug-in DLLs, they will be automatically loaded when the site is run, it is important that the project itself DLL and project introduced DLL will automatically load, this is no problem, and plug in the bin directory DLL will automatically load, This is important because it makes our applications more flexible and more scalable in the development of common functionality!

An example, such as a HttpModule, is a generic feature that adds some shared information about cache expiration to the page, which is common to all of your sites, so that you can build a HttpModule project where the code might be

namespacetesthttpmodule{ Public classSeomodule:ihttpmodule {#regionIHttpModule Members Public voidDispose () {Throw Newnotimplementedexception (); }         Public voidInit (HttpApplication context) {context. BeginRequest+=NewEventHandler (context_beginrequest); }        voidContext_beginrequest (Objectsender, EventArgs e) {            varApplication =(HttpApplication) sender; Application. Context.Response.Expires=0; Application. Context.Response.ExpiresAbsolute= DateTime.Now.AddDays (-1); Application. Context.Response.AddHeader ("pragma","No-cache"); Application. Context.Response.AddHeader ("Cache-control","Private"); }        #endregion    }}

For the catalog site, you only need to configure the module in Web. config.

  </pages>    "seomodule" type= " Testhttpmodule.seomodule "/>    

This module.dll is copied directly to the bin directory of the target website, and the Web site can be loaded automatically.

In fact, through this project of. NET applications, we can develop a lot of common modules, and a good combination of specific projects, to achieve the specific project of "functional hot-swappable"!

Back to Catalog

The foundation is the heavy weight-assembly auto-load under the site Bin directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.