Windows7下启用IIS7配置ASP运行环境的详细方法及常见调试问题

一、安装IIS7

开始-控制面板-默认程序-程序和功能-打开或关闭windows功能。

注意:设置ASP的时候,Application Development Features下的ASP,ASP.NET一定要勾选好

二、配置IIS

1. IIS Manager可以在管理工具中找到。点击站点,在web home页面中可以看到ASP的图标。

注意:如果没有ASP的图标,可能是在安装IIS的过程中没有勾选ASP选项

2、启用Parent Paths: 选择站点,双击ASP图标,将“Enable Parent Paths” 设置为“True”,右边栏点击“Apply”。

 3. If IIS installed after .Net framework v4.0, the framework need to be reinstalled:

Resolve: "CMD"-> Run as administrator -> %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

 4. Modify file Web.config:

<configuration>
  <connectionStrings>
    <add name="ClientConnectionString" connectionString="Data Source=localhost;Initial Catalog=Client;User ID=aaaa;Password=aaaaa" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <httpRuntime/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

a. Framework between IIS Server and the project build framework: targetFramework record the setting Framework in Properties. If .Net 4.0 was set in IIS, the target Framework should be set on 4.0. If they were not match, there will be a "Sever Error" error.

  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <httpRuntime/>
  </system.web>

      Resolve1:  Change project framework to the IIS server version, rebuild the project.(non-large project)

      Resolve2:  Configrate Application Pools in IIS, select and click one item and select the right Framework.

stackoverflow: When .NET 4.5 is installed it effectively replaces .NET 4.0 on the machine. .NET 4.0 gets overwritten by a new version of .NET 4.5 which - according to Microsoft - is supposed to be 100% backwards compatible.

Notice: Project framework use .Net 4.5 and .Net 4.5 could not display in IIS server(It always display .Net 4.0), so please make sure your server install .Net 4.5.

 b. delete one compiler.

Resolve:  Delete the Line.

三、配置IIS7的默认网站

 1. Click the "ASP" icon ->"Advanced Setting" -> select the Physical Path

  2. Add the Default Document

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值