从 CASSINI 传递到 IIS 7
您好,我正在部署之前在本地计算机上测试网站。
当使用 VS 2010 与 CASSINI 一起运行该站点时,一切工作正常......没有错误。 当我在内部 IIS 7 上构建包并部署时...加载默认页面时,IIS 7 不显示请求的页面(都没有错误),而是让浏览器下载页面而不显示它。
我的本地 IIS 中有另一个测试站点,它工作正常。
因为 IIS 没有显示任何类型的错误(即使调试为真),我无法找出问题所在。
这里有一些问题希望您能够帮助我:
- 我需要在 web.config 中进行一些配置更改吗
- ?有任何线索为什么会出现这种行为吗?
- 有什么方法可以调试这种情况吗?
这是我的 web.config 文件: 请告诉我,谢谢
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="myWebAppSettings" type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<myWebAppSettings isTestEnvironment="false" />
<system.webServer>
<directoryBrowse enabled="false" />
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" />
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
</system.webServer>
<connectionStrings>
<add name="CmsConnectionString" connectionString="Data Source=.; Initial Catalog=SiteNameExtension; Integrated Security=SSPI" />
<add name="CmsConnectionStringEntityDataModel" connectionString="Metadata=res://*/; provider=System.Data.SqlClient;provider connection string="
 Data Source=.;Initial Catalog=SiteNameExtension;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<globalization culture="en" uiCulture="en" />
<pages enableViewState="true" theme="Cms-FE-00" validateRequest="true">
</pages>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="WebProject.Core"/>
<add assembly="WebProject.DataAccess"/>
<add assembly="WebProject.Cms"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2880" />
</authentication>
<roleManager enabled="true" cacheRolesInCookie="true">
<providers>
<clear />
<add connectionStringName="XXXXX" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" connectionStringName="XXXXX" applicationName="/" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="16" minRequiredNonalphanumericCharacters="4" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
</providers>
</membership>
</system.web>
</configuration>
Hi i'm testing a website on my local computer before deployment.
When running the site with CASSINI using VS 2010 all is working fine... no error.
When I Build a Package and Deploy on my Internal IIS 7 ... when loading the default page IIS 7 do not show up the page requested (neither errors) and let the browser DOWNLOAD the Page instead and do not displaying it.
I have another test site in my local IIS and it is working fine.
Because IIS does not show any error of any type (even if debug is true) I'm not able to figure out what is the problem.
Here some questions hope you are able to help me out:
- do i need some change in configuration in web.config
- any clue why this behavior?
- any way to debug this situation?
here my web.config file:
Please let me know thanks
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<section name="myWebAppSettings" type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<myWebAppSettings isTestEnvironment="false" />
<system.webServer>
<directoryBrowse enabled="false" />
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" />
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
</system.webServer>
<connectionStrings>
<add name="CmsConnectionString" connectionString="Data Source=.; Initial Catalog=SiteNameExtension; Integrated Security=SSPI" />
<add name="CmsConnectionStringEntityDataModel" connectionString="Metadata=res://*/; provider=System.Data.SqlClient;provider connection string="
Data Source=.;Initial Catalog=SiteNameExtension;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<globalization culture="en" uiCulture="en" />
<pages enableViewState="true" theme="Cms-FE-00" validateRequest="true">
</pages>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="WebProject.Core"/>
<add assembly="WebProject.DataAccess"/>
<add assembly="WebProject.Cms"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2880" />
</authentication>
<roleManager enabled="true" cacheRolesInCookie="true">
<providers>
<clear />
<add connectionStringName="XXXXX" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" connectionStringName="XXXXX" applicationName="/" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="16" minRequiredNonalphanumericCharacters="4" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
</providers>
</membership>
</system.web>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来 ASP.NET 版本的处理程序未在服务器上注册或已禁用。您应该能够使用 SDK 中的 aspnet_regiis 安装它。或者应用程序池(如果不同)设置为错误的 ASP.NET 版本。
Sounds like the handler for the ASP.NET version isn't registered on the server or disabled. You should be able to install it using aspnet_regiis from the SDK. Or the app pool ( if it differs ) is set to the wrong version of ASP.NET.
确保在服务器上运行 Web 应用程序的应用程序池使用正确的(在您的情况下为 .NET 4.0,如 web.config 文件中所述).NET 框架。
我相信 IIS 7.x 默认使用 .NET Framework 2.0。
Make sure that the application pool that is running your web application on the server is using the correct (in your case .NET 4.0 as stated in the web.config file) .NET framework.
I believe IIS 7.x is defaulting to using .NET framework 2.0.