1.需要使IIS支持.net4.5
安装完成.net4.5需要的cmd中执行
执行完成之后,在IIS应用池中显示的还是4.0,但是版本号不同了
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
2.web.config需要配置
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<customErrors mode="Off" /> //此项是新增
<compilation targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<connectionStrings>
<add name="connSql" connectionString="Server=localhost;DataBase=dataName;Uid=sa;Pwd=sa" />
</connectionStrings>
<system.webServer>
<defaultDocument>
<files>
<add value="default.html" />
</files>
</defaultDocument>
</system.webServer>
</configuration>