[Reprint] DottText source code reading (1)-debugging

Source: Internet
Author: User
From: License, instructions on this edition in: http://forums.cnblogs.com/ShowThread.aspx? PostID = 485 after the download, a project file exists in the following directory, which is a project of v003. Because it is an asp.net project, you need to configure IIS to ensure that all the projects are clipped successfully. For more information, see OtherStuff/installation instructions. 1. Create a DottextWeb virtual directory pointing to CNBlogsDotText \ DottextWeb. This virtual directory is used for. NET open the DottextWeb project, do not create *. * asing to asp.net. 2. Create a virtual directory for accessing the site, point to CNBlogsDotText \ DottextWeb, and create a ing comment *. * To asp.net: You can see that two virtual directories are created here. The first virtual directory meets the needs of opening the vs2003 project, because the project configuration file needs to read the project file from IIS using the frontpage method, there are references to this virtual directory. The second virtual directory is used for debugging, because the dottext web. config takes over all accesses to all types of http files in the directory. Therefore, IIS needs to pass all requests to the asp.net framework, and *. * ing to asp.net ensures that dottext takes over and analyzes and processes every request to the blog application. Specifically, to facilitate the test (to maintain the test environment and the actual running environment), I created a test environment on the local machine to meet the same requirements as the blog.xxx.cn domain name of my company, I used another blog.test.com ,. I added a line 127.0.0.1 blog.test.com TO THE \ system32 \ drivers \ etc \ host file and created a new site host header to bind blog.test.com to my LAN Ip address, and the directory is set to the directory where DottextWeb is located. According to the requirements of 2, * is added *. * asing to asp.net. In this way, you can use blog.text.com locally for debugging, and then overwrite the previous version without worrying about anything. 3. Install the database. Run the DotTextData. SQL script in OtherStuff \ SQL Scripts to automatically create the DotTextData database. You can also create a database and then run the DotTextData. SQL script. Ignore the script installation error prompt and it does not affect normal use. 5. initialize the database and run the InitData. SQL and SkinControl scripts respectively. 6. Configure the database connection string in web. config, that is, the connectionString in <DbProvider>. Note: here, make sure that the strings on the actual running and development machines are the same. Otherwise, modifying web. config will be annoying. At the same time, you need to configure the SQL link client (If SQL is used ). 7. After the above configuration is complete, you can access it. 8. register a new user through "new blog registration" and add the user to the site administrator group. Operation Method: Add a record to the table blog_UsersInRoles, the UserID is the BlogID of the user you just registered, and the RoleID is 1 (the RoleID of the administrators in the blog_Roles table ). Note: The purpose of this rule is to allow you to have an administrator account for system Classification configuration. This account is slightly different from the background management interface of other accounts that apply for registration. There is an additional management TAB page. 9. Add A website category. A. Log On As an administrator and go to the Management page. Open "Manage" Page B. Select "Edit website category ", add a category C, click "Config" in the category name, and then select "add. if the "Access Denied" error occurs when writing data to the config file, it is because the program is installed on the NTFS partition, and the user running the IIS process has no write permission on the folder where the program is located, you need to modify the permission settings. 10. Set the default website category displayed on the homepage. Set <SiteBlogConfig> to <IsDefault> true </IsDefault> In SiteBlogConfig. config. By default, the "Homepage" category is set to <IsDefault> true </IsDefault>, and all categories are displayed. Note: After the above installation, you can browse it locally. However, the interface is quite rough. Generally, every company will beautify the index pages of the blog site and the index pages of other sub-columns. Therefore, you need to beautify the pages first and then add them to the site. The page for replacing the system by modifying the configuration will be introduced later. These need to be thoroughly understood after reading the source code. Haha. When debugging is directly pressed in VS, iis does not map all files to the asp.net framework because it runs the directory in 1 mentioned above. net runtime error, so you should not directly debug, but start the process debugging. The specific method is: first restart blog.test.comto start the first page (let the system start w3wp.exe, version 2000 is), then select the debugging process in the debugging menu, In the process list that appears, find the application process corresponding to blog.test.com, then attach and make sure that the CLR debugging option is selected. At this point, VS will enter the debugging status, and we will start accessing the corresponding page. If a breakpoint is added, it will enter the breakpoint tracking status accordingly. Update, the default version is release. In the Starting Status, ping blog.test.com to the local machine IP3, configure the Host Header, add this host header to the second blog site, and access blog.test.com to the site. Select the starting one. If there are several processes with the same name, then... Simply put, the w3svc service is restarted, and nothing else is done. Once you access blog.test.com, there is naturally only one asp.net application process. 6. Select it and click "add... "will be automatically appended. In the pop-up dialog box, the common language runtime must be selected. 7. After closing is confirmed, vs will enter the debugging status. You can add breakpoints at will, then, access a specific url to activate the breakpoint. 8. If the problem persists, ask your colleagues in the company before asking them to post questions. My email: myjobsdk # yahoo.com.cn. I can only check this email from time to support this article. Thank you for your attention. I hope you can add your shortcomings! Update: some brothers asked how to configure *. * The asing to asp.net is hereby added: the configuration of windows2000 and windows2003 is different. The configuration of 2000 is as follows: 1. the iis manager opens the attributes of the blog site. 2. The main directory, select Configuration in application settings... 3. Application ing, and click Add... 4. Select WINNT \ Microsoft as the executable file. NET \ Framework \ v1.1.4322 \ aspnet_isapi.dll. net framework current version consistent 5, extension input *, method: GET, POST 6, do not select "check whether the file exists", select the ing between * And aspnet_isapi.dll not supported by Script Engine 2003, required: 1. Enable the attributes of the blog site in iis Manager

2. Main directory. Select Configuration in application settings... 3. ing: application extension cannot input * asping to aspnet_isapi.dll.

4. Insert C: \ WINDOWS \ Microsoft in the following wildcard application ing (execution sequence. NET \ Framework \ v1.1.4322 \ aspnet_isapi.dll, make sure that you do not select "check whether the file exists" or "check whether the file exists" to prevent requests from being processed by aspnet_isapi.dll when accessing resources that do not exist in the physical file, that is, enter. net execution framework

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.