Eight best practices in ASP. NET development (1)

Source: Internet
Author: User

BKJIA exclusive translation] explore some best practices in ASP. NET application development and perform these useful procedures to improve your application performance. This article shows eight best practices that you can follow when developing ASP. NET Applications in production mode.

1. Use version control to control your Assembly

Make sure that you have a set of appropriate version control policies. during compilation, you can use the assembly version attribute to apply the version flag, for example:

[Assembly: assembly version ("1.0.12.34")]

During the build process, the version number of an application is usually the same.

2. Give the Assembly a strong name

An assembly is the minimum unit for version control and code reuse, including:

◆ Assembly ID information name, version, etc)
◆ List and metadata
◆ MSIL code
◆ Type and Security Information
◆ Resources

An assembly with a strong name can uniquely identify it together with its version information, region information, and digital signature.

The Secret tool creates a strong-name key file from the command line, such:

Sn -- k MyCompany. snk

When you execute the preceding command, you will see the content output shown in 1.

BKJIA exclusive translation] explore some best practices in ASP. NET application development and perform these useful procedures to improve your application performance. This article shows eight best practices that you can follow when developing ASP. NET Applications in production mode.

1. Use version control to control your Assembly

Make sure that you have a set of appropriate version control policies. during compilation, you can use the assembly version attribute to apply the version flag, for example:

[Assembly: assembly version ("1.0.12.34")]

During the build process, the version number of an application is usually the same.

2. Give the Assembly a strong name

An assembly is the minimum unit for version control and code reuse, including:

◆ Assembly ID information name, version, etc)
◆ List and metadata
◆ MSIL code
◆ Type and Security Information
◆ Resources
An assembly with a strong name can uniquely identify it together with its version information, region information, and digital signature.

The Secret tool creates a strong-name key file from the command line, such:

Sn -- k MyCompany. snk

When you execute the preceding command, you will see the content output shown in 1.


Figure 1. Create a strong-name key file

When you create a project in Visual Studio, you will see a project called AssemblyInfo. cs default file, you can use it to specify the relevant attributes, which is listed below in AssemblyInfo. strong name information that can be specified in the cs file.

[Assembly: AssemblyCulture ("")] assembly: assembly Region ("")]
[Assembly: AssemblyVersion ("1.0.0.0")] assembly: assembly version ("1.0.0.0 ")]
[Assembly: AssemblyKeyFile ("MyCompany. snk")] assembly: assembly key file ("MyCompany. snk "]

3. disrupt your Assembly

Before you start to deploy an assembly, it is best to disrupt it, which makes it more difficult to decompile and prevents reverse engineering attempts. Therefore, protect your source code against potential threats. In addition, if an assembly is disrupted, the size of the Assembly can be reduced to improve the application performance.

Related Article

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.