Install IIS 7.5 in win7 and deploy. Net program to IIS

Source: Internet
Author: User

1. If the original Visual Studio is not installed. NET Web Developer (that is, developing ASP.. NET Website). After Visual Studio SP1 is installed, add it again. NET Web Developer. An error is reported when you add a Visual Studio component. You need to uninstall SP1, Add. NET web developer, and upgrade SP1 again. (This step takes a long time. You can go out and smoke two cigarettes ...)

2. Installing IIS 7.5 in win7 is quite convenient, but it is hidden by the system. Here:

It is important to select"Bearer web Core", Otherwise, after IIS is successfully installed, all open blank pages.

Reference: http://www.windows7en.com/Win7Down/12462.html

Iii. developed for. Net 4.0 or aboveProgramIn IIS configuration, select the ". NET Framework Version"Application pool".

4. If the following error occurs:

Solution: re-register the ASP. NET 4.0 framework as an administrator. The command is:

 

% Windir % \ Microsoft. NET \ framework \ v4.0.30319 \ aspnet_regiis.exe-I

Reference: http://hi.baidu.com/love_1210/item/1971ce45c4bcd8e6bdf451dd

 

5. When writing a. Net website, there is a"App_code"Folder,Cannot Be Renamed!!

6. If you select

After a website is published, the following error may occur:

 

 
Analyzer error message: the type "service1" cannot be created ". Source error: Row 1: source file:/web/service. asmx row: 1


The solution is to generate a website for publishing Visual Studio
"Bin" directory, put it under the root directory of IIS.

 

Reference: http://blog.csdn.net/zhpch1984/article/details/6837299

Vii. In the above steps, the. CS file of the site is pre-compiled with Visual Studio and compiled into app_code.dll and put into the bin directory. If the website project is large and the generated. dll file is overwritten with each other, you will not be able to play. There are two solutions:

1. In the Visual Studio project, create a subdirectory under the "app_code" folder, for example, "pkustudentinfo", and put the corresponding. CS file under the directory. Add the following content to the Web. config file:

 

 
<Configuration> <system. web> <compilation> <codesubdirectories> <add directoryname = "pkustudentinfo"/> </codesubdirectories> </compilation> </system. web> </configuration>

Then, when Visual Studio publishes a website, app_subcode_pkustudentinfo.dll is generated, which is classified by module. But this is also a bad thing: when accessing IIS, it will prompt

 

"Codesubdirectories cannot be defined at the application level"

The solution is to delete the "codesubdirectories" node and Its subnodes in the final web. config file after Visual Studio is generated.

Reference: http://www.cnblogs.com/qiantuwuliang/archive/2009/03/06/1404643.html

Reference: http://msdn.microsoft.com/zh-cn/library/exchange/54dwfbb7

2. Use Microsoft's official tool ilmerge to merge multiple assemblies (which can be renamed once a single one:

Http://www.microsoft.com/en-us/download/details.aspx? Id = 17630

Reference: http://bbs.csdn.net/topics/100025265

8. After Visual Studio pre-compilation is enabled, the. dll file compiled can be used

 

 
Httpruntime. appdomainapppath

To obtain the directory where the. dll file is located.

 

Available

 

 
System. appdomain. currentdomain. basedirectory

To obtain the current working directory of the web.

 

Reference: http://blog.csdn.net/yueue/article/details/1823512

 

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.