记录一次iis发布的经历<compilation debug="true" targetFramework="4.0">报错,默认画面不起作用

本文记录了一次在IBM服务器上部署Silverlight应用的过程与遇到的问题。主要问题包括.NET Framework 4.0安装不完整导致的服务安装失败及IIS部署错误。通过重新安装.NET Framework 4.0和调整IIS配置解决了这些问题。

客户服务器环境:ibm服务器,windows2003企业版  内存32G,ii6.

发布目标:SliverLight程序,一个等值面图后台windows服务器。

安装过程:

   第一步:安装了.net2.0,.net3.5sp1(arcgis需要),.net4.0(程序需要)

  第二部:  安装widows服务失败   没有显出具体的错误原因安装服务用的是installutil.exe。

  第三部:  部署iis程序失败报错:<compilation debug="true" targetFramework="4.0">


   因为之前安装过程.netFramework从来没有出过问题,就理所当然的没想是.netFramework出了问题。一顿查找原因,一度以为是因为64位操作系统的问题,由于是2003系统,一顿dos命令,把32位兼容模式打开,重新注册32位的.net,但是没有解决,后来跟客户电话沟通了下,系统是32位的,这块补充一下,不要以为系统支持4G以上的内存就是64位系统,32位系统也是可以支持到4G以上的。随后会把64位windows2003下设置32位兼容模式及使用32位.netFramework的命令行命令参见:Windows Server 2003 x64 IIS配置

  后来跟同事讨论,他的一句话给我了灵感,看了看添加删除程序里的.net4.0发现才几M,肯定是不对的,但是之前安装过程也没出错,就没往这方面想,赶紧重新安装.net4.0,安装之后再次访问ok了,windows服务也可以正确安装了(installutil 服务.exe)。

  随后的问题更是有些奇怪,设置的默认主页不起作用,各种重启后无果,就查了查,网上说的最多的就是"因为服务器同时安装有ASP.NET2.0和ASP.NET4.0,造成了冲突,导致2.0的网站打不开。将站点升级到ASP.NET4.0,结果成功打开了默认首页。",但是我的客户的应用程序服务器就部署了一个程序,不存在冲突的问题,iis右键属性一项一项的看,突然发现,之前<compilation debug="true" targetFramework="4.0">报错时网上说要在下图红框出需要配置一项“C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll”,正是由于该项导致了默认画面不起作用,把该项删除后,默认画面又重新开始起作用。

   

     


<?xml version="1.0" encoding="utf-8"?> <!-- 有关如何配置 ASP.NET 应用程序的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <connectionStrings> <add name="DB-NetShopsConnectionString" connectionString="Data Source=.\MSSQLSERVER2012;Initial Catalog=DB-NetShops;User ID=sa;Password=your_password;Integrated Security=False" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <!-- 添加全局cookie设置 --> <httpCookies httpOnlyCookies="true" /> <compilation debug="true" targetFramework="4.7.2" /> <httpRuntime targetFramework="4.7.2" maxRequestLength="20480" executionTimeout="300" requestValidationMode="4.7.2" /> <!-- 移除httpOnlyCookies属性 --> <sessionState mode="InProc" timeout="20" /> <authentication mode="Forms"> <!-- 移除httpOnlyCookies属性 --> <forms loginUrl="~/WebForm1.aspx" defaultUrl="~/WebForm2.aspx" timeout="20" /> </authentication> <globalization culture="zh-CN" uiCulture="zh-CN" requestEncoding="utf-8" responseEncoding="utf-8" /> <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx"> <error statusCode="404" redirect="~/404.aspx" /> <error statusCode="500" redirect="~/500.aspx" /> </customErrors> <pages masterPageFile="~/Site.master"> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages> </system.web> <system.webServer> <httpProtocol> <customHeaders> <add name="X-Content-Type-Options" value="nosniff" /> <add name="X-Frame-Options" value="SAMEORIGIN" /> <add name="X-Xss-Protection" value="1; mode=block" /> </customHeaders> </httpProtocol> <staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> </staticContent> <security> <requestFiltering> <requestLimits maxAllowedContentLength="20971520" /> </requestFiltering> </security> </system.webServer> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" /> </compilers> </system.codedom> </configuration> 添加母版页代码设置,生成完整webconfig代码
06-12
<configuration> <connectionStrings> <add name="DB-NetShopsConnectionString" connectionString="Data Source=.\MSSQLSERVER2012;Initial Catalog=DB-NetShops;User ID=sa;Password=your_password;Integrated Security=False" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.7.2" /> <httpRuntime targetFramework="4.7.2" maxRequestLength="20480" executionTimeout="300" requestValidationMode="4.7.2" /> <!-- 修正 sessionState 属性名 --> <sessionState mode="InProc" timeout="20" httpOnlyCookies="true" /> <!-- 正确:httpOnlyCookies(无多余s) --> <authentication mode="Forms"> <!-- 修正 forms 属性名 --> <forms loginUrl="~/WebForm1.aspx" defaultUrl="~/WebForm2.aspx" timeout="20" httpOnlyCookies="true" /> <!-- 正确:httpOnlyCookies(无多余s) --> </authentication> <globalization culture="zh-CN" uiCulture="zh-CN" requestEncoding="utf-8" responseEncoding="utf-8" /> <customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx"> <error statusCode="404" redirect="~/404.aspx" /> <error statusCode="500" redirect="~/500.aspx" /> </customErrors> </system.web> <system.webServer> <httpProtocol> <customHeaders> <add name="X-Content-Type-Options" value="nosniff" /> <add name="X-Frame-Options" value="SAMEORIGIN" /> <add name="X-Xss-Protection" value="1; mode=block" /> </customHeaders> </httpProtocol> <staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" /> </staticContent> <security> <requestFiltering> <requestLimits maxAllowedContentLength="20971520" /> </requestFiltering> </security> </system.webServer> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" /> </compilers> </system.codedom> </configuration> 报错允许使用httpOnlyCookies特性
06-10
请帮我分析一下以下代码的作用:<?xml version="1.0" encoding="UTF-8"?> <configuration> <appSettings> <add key="version" value="1.0.9.x" /> <add key="release" value="2014-09-01" /> <add key="mbrImage" value="" /> <add key="venImage" value="" /> <add key="logPath" value="" /> <add key="cardUIdLen" value="8" /> <add key="acsPwdLen" value="4" /> <add key="sysPwdMinLen" value="8" /> <add key="importFilePath" value="~/imports" /> <add key="serviceTimeout" value="1000" /> <add key="Telerik.Skin" value="Office2007" /> <add key="vs:EnableBrowserLink" value="false" /> </appSettings> <connectionStrings> <add name="dbConnStr" connectionString="Data Source=localhost;Initial Catalog=JHICC_DB;Persist Security Info=True;User ID=sa;Password=27745518" providerName="System.Data.SqlClient" /> <add name="TestdbConnStr" connectionString="Data Source=localhost;Initial Catalog=TemporaryMbr;Persist Security Info=True;User ID=sa;Password=27745518" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" /> <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" /> <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> </assemblies> <buildProviders> <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> </buildProviders> </compilation> <pages> <controls> <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /> </controls> </pages> <httpHandlers> <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" /> <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" /> <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> <add path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" verb="*" /> </httpHandlers> <httpModules> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" /> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> </httpModules> <identity impersonate="false" /> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true"> <remove name="RadUploadModule" /> <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" /> <remove name="RadCompression" /> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" /> </modules> <handlers> <remove name="ChartImage_axd" /> <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" /> <remove name="Telerik_Web_UI_SpellCheckHandler_axd" /> <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" /> <remove name="Telerik_Web_UI_DialogHandler_aspx" /> <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" /> <remove name="Telerik_RadUploadProgressHandler_ashx" /> <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" /> <remove name="Telerik_Web_UI_WebResource_axd" /> <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" /> <remove name="ReportViewerWebControlHandler" /> <add name="ReportViewerWebControlHandler" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" verb="*" preCondition="integratedMode" /> </handlers> </system.webServer> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_ISoapService" /> <binding name="BasicHttpBinding_ISoapService1" /> <binding name="BasicHttpBinding_ISoapService2" /> <binding name="BasicHttpBinding_ISoapService3" /> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:4559/RFTagService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISoapService" contract="soapService.ISoapService" name="BasicHttpBinding_ISoapService" /> <endpoint address="http://localhost:4560/RFTagFireAlarmService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISoapService1" contract="fireAlarmService.ISoapService" name="BasicHttpBinding_ISoapService1" /> <endpoint address="http://localhost:4561/RFTagDataSyncService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISoapService2" contract="dataSyncService.ISoapService" name="BasicHttpBinding_ISoapService2" /> <endpoint address="http://localhost:4562/RFTagMailAlertService" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISoapService3" contract="mailAlertService.ISoapService" name="BasicHttpBinding_ISoapService3" /> </client> </system.serviceModel> </configuration>
最新发布
09-29
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值