"Asp. Net 2.0 secrets" Reading Notes (14th)

Source: Internet
Author: User

Create component

First, the components here are not components of the general sense

* A major defect in the dynamic compilation process is that if any component error occurs, the entire site may fail to run;

* Components written in different languages must be placed in different folders. If they are written in one language, they do not matter;

* Static is called shared in other languages. It does not belong to any instance. This is a good sentence. I still don't understand it when I learned C ++, it has always been understood from its implementation mechanism, but it remains static. After a while, I did not think so much, but I have never understood the shortcomings, sharing two words is really good. The last half also explains why static variables cannot reference other variables;

* Asp. using shared member variables and attributes in a multi-threaded environment such as. Net may cause some strange multi-threaded concurrency problems. If you must use static attributes, define them as read-only; this problem has always plagued me. Well, reading good books has benefited a lot;

* The static constructor is executed only once before all instance constructor executions. Haha, I realized it when I saw someone using it, think about how I feel like I'm a genius ~

* Abstract classes are the foundation of Asp. Net 2.0 providers, such as Personalization, Membership, Roles, and so on;

* When creating a component class library, System. Web. dll references are generally referenced;

* There are two methods to reference. One is to put the file in the Bin directory. If you do not know what is going on, windows programs will automatically search for the assembly in the Bin folder under the current directory, c: \ windows \ assembly

* If the KeyPair file is saved as a temporary credential, you must first register the program set and run the command line tool (sn.exe-k KeyPair. snk) to generate the KeyPair. snk file. A public/private key is randomly generated;

* In AssemblyInfo. cs

[assembly:AssemblykeyFile("KeyPair.snk")][assembly:AssemblyVersion("0.0.0.0")]

The four zeros represent the major version number, minor version number, build number, and revision number respectively.

* Add the following command line (gacutil.exe/I MyLibrary. dll)

* Example code for adding a reference to config:

<system.web>  <comilation>    <assemblies>      <add assembly="MyLibrary,Version=0.0.0.0,Culture=neutral,PublicKeyToken=123456123456"/>    </assemblies>  </coml\pilation></system.web>
* Generally, the use of global application sets is avoided.
* When the program begins to design the architecture, there will be many questions worth thinking about. Anyway, I only know that there is no perfect design, but it is best suited to the current design!
Come on, come on;
* Simple three-tier Application page468

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.