Compile a simplest webpart (2): Configure webpart

Source: Internet
Author: User
Tags reflector

Summary

This article will record how to write the second part of the simplest webpart, that is, configuring webpart, including creating a strong name for the webpart and configuring web. config.

Body

The procedure of each step is recorded below.
1. First, open the project you created, right-click the project name in Solution Explorer, and select Properties from the pop-up menu. The properties box of the Project is displayed, select the signature page in the property box.
On the signature page, sign the Assembly and select new from the select strong name key file drop-down box.


2. In the create strong-name key dialog box that appears, enter the key file by name, for example, key. SNK, and remove the check mark before the password-protected key file.

3. After the key file is created, a key. SNK file is added to the project.
At this point, all the work of the project is complete, and we can compile the project.


4. Configure web. config.
To find the assembly information of the webpart project, we need to use third-party software, such as reflector. Please download the free reflector from the Internet.
Open reflector, find hello. dll in the bin \ debug sub-folder under the project folder, and drag it into reflector. In this way, we can easily find the assembly information (that is, the content after name ).

5. Open the site folder created in this series of articles and find the Web. config file.

6. Open the Web. config file, where <safecontrol> ...... </Safecontrol> to add a configuration line. The content in the Assembly attribute is directly copied from reflector.

7. In the above folder, we can see a sub-folder of _ app_bin. We will copy the compiled hello. DLL to this folder.
Now, all webpart configuration is complete.
In the next article, I will record how to write the third part of the simplest webpart. Thank you for your attention!
"This article is the result of my work. If you have reprinted it, please indicate the source! Thank you for your cooperation ."

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.