ASP.NET<compilation debug="false" targetFramework="4.0"/>错误

本文介绍如何在IIS中将默认的应用程序池从DefaultAppPool更改为ASP.NET v4.0的方法,这对于运行特定版本的.NET应用至关重要。

解决方法:在IIS中网站管理->高级设置->应用程序池 将DefaultAppPool修改为ASP.NET v4.0. 如下图所示:



<?xml version="1.0" encoding="utf-8"?> <!-- 有关如何配置 ASP.NET 应用程序的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <!-- 有关 .NET 4.5 的 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。 可在 <httpRuntime> 标记上设置以下特性。 <system.Web> <httpRuntime targetFramework="4.5" /> </system.Web> --> <system.web> <compilation debug="true" targetFramework="4.0" /> <!-- 设置 ASP.NET 的最大请求长度 (单位: KB) --> <!-- 例如:50MB = 51200 KB --> <httpRuntime maxRequestLength="51200" executionTimeout="3600" /> <pages controlRenderingCompatibilityVersion="4.0" /> <webServices> <protocols> <!--add name="HttpSoap1.2" /--> <add name="HttpSoap" /> <add name="HttpPost" /> <add name="HttpGet" /> <add name="Documentation" /> </protocols> </webServices> </system.web> <system.webServer> <!--// 解决跨域请求 by wys--> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Methods" value="OPTIONS,POST,GET" /> <add name="Access-Control-Allow-Headers" value="x-requested-with,content-type" /> <add name="Access-Control-Allow-Origin" value="*" /> </customHeaders> </httpProtocol> <security> <requestFiltering> <!-- 设置 IIS 层面的最大请求内容长度 (单位: 字节) --> <!-- 50MB = 50 * 1024 * 1024 = 52428800 字节 --> <requestLimits maxAllowedContentLength="52428800" /> </requestFiltering> </security> </system.webServer> <connectionStrings> <add name="_Default" connectionString="data source=ORCL;uid=sst_user;pwd=123;" providerName="System.Data.OracleClient" /> </connectionStrings> <appSettings> <add key="SqlPath" value="d:\" /> <add key="DefaultSqlXmlFileName" value="Sqls" /> <add key="DBWriteLog" value="false" /> <add key="DBLogFill" value="false" /> <add key="DBLogExec" value="false" /> <add key="DBLogUpdate" value="false" /> <add key="CompareAllValuesWhenUpdate" value="false" /> <add key="UnifiedParamPrefix" value="^" /> <add key="BlobFilePath" value="Files\" /> <add key="HisBlobFilePath" value="Backup\" /> </appSettings> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding" closeTimeout="00:59:59" openTimeout="00:59:59" receiveTimeout="00:59:59" sendTimeout="00:59:59" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483646" maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="2147483646" maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="WCFServerCABehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" /> <services> <service behaviorConfiguration="WCFServerCABehavior" name="HY.Application.Service.Edf.EdfService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" name="BasicHttpBinding_IEdfService" contract="HY.Application.API.Edf.IEdfService" /> </service> <service behaviorConfiguration="WCFServerCABehavior" name="HY.Application.Service.Edf.BaseService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" name="BasicHttpBinding_BaseService" contract="HY.Application.API.Edf.IBaseService" /> </service> <service behaviorConfiguration="WCFServerCABehavior" name="HY.Application.Service.Edf.CnasService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" name="BasicHttpBinding_CnasService" contract="HY.Application.API.Edf.ICnasService" /> </service> <service behaviorConfiguration="WCFServerCABehavior" name="HY.Application.Service.Sst.SstService"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" name="BasicHttpBinding_SstService" contract="HY.Application.API.Sst.ISstService" /> </service> </services> </system.serviceModel> </configuration> <!--ProjectGuid: D349DA0A-BC95-436E-92FE-9BD47EB8E4C7--> 基于这个去改
12-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值