简体   繁体   English

IIS7到IIS6的web.config迁移问题

[英]IIS7 to IIS6 migration web.config problems

I have a web application that I wrote in Visual Studio 2008 that targets .Net Framework 3.5. 我有一个我在Visual Studio 2008中编写的针对.Net Framework 3.5的Web应用程序。 To test it I used a machine running Windows 7, which means IIS7. 为了测试它,我使用了运行Windows 7(即IIS7)的计算机。 My application works just fine on this but when it was deployed to a development server (running server 2003, so IIS6) it doesn't work. 我的应用程序可以很好地工作,但是当它部署到开发服务器(运行服务器2003,因此是IIS6)时,它不起作用。

The first few lines of my web.config file are as follows: 我的web.config文件的前几行如下:

<?xml version="1.0"?><configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

The error I get has to do with the type= part of the sectionGroup tag. 我得到的错误与sectionGroup标记的type =部分有关。 I don't remember the exact message, but it is something along the lines of 'invalid tag' or 'invalid attribute.' 我不记得确切的消息,但这是“无效标签”或“无效属性”的意思。

I have two questions: 我有两个问题:

  • First, is anyone savvy enough with IIS to know why this works in 7 and not 6? 首先,是否有人对IIS足够了解,所以知道为什么它可以在7(而不是6)中工作?
  • Second, why do I need the sectionGroup tag? 其次,为什么需要sectionGroup标记? What does it do? 它有什么作用?

I checked the dev server to make sure the right version of .net was installed. 我检查了开发服务器,以确保安装了正确版本的.net。 It has 2, 3, 3.5, and 4, so I should be covered on that front. 它有2、3、3.5和4,因此我应该在那方面进行介绍。

I'm rather new to .net (probably obvious by now), so please forgive me if this has been asked a thousand times and it looks like I'm beating dead horses. 我对.net相当陌生(现在可能很明显),因此,如果这个问题被问了上千次,并且看起来好像我在击败老马,请原谅我。 My googling and searching of stackoverflow didn't provide a solution. 我在Google搜索和搜索stackoverflow上没有提供解决方案。

SOLUTION: The whole problem was IIS not being configured correctly. 解决方案:整个问题是未正确配置IIS。 The asp.net tab of the website's properties was set to 2.0.something. 网站属性的asp.net选项卡设置为2.0.something。 We changed it to 4.0.something (3.5 wasn't an option) and everything works just fine. 我们将其更改为4.0.something(不是3.5),一切正常。

Your framework targets .NET 3.5. 您的框架针对.NET 3.5。 It probably doesn't matter whether you use the scripting section or not, but the scripting section is configured with 3.5. 是否使用脚本部分可能并不重要,但是脚本部分配置了3.5。 This is used for the client scripts of the ASP.NET Ajax Scripts. 这用于ASP.NET Ajax脚本的客户端脚本。

If you run your application in IIS 6, it depends on which framework version you have configured for the application pool. 如果您在IIS 6中运行应用程序,则取决于您为应用程序池配置的框架版本。 If you mix your applications, it might start in the wrong version. 如果您混合使用应用程序,则它可能以错误的版本开头。 Check that you configure your pool correctly. 检查您是否正确配置了池。 Unfortunately I don't have an IIS 6 here I can't remember exactly how you do that. 不幸的是,我这里没有IIS 6,我不记得您是怎么做到的。 Important is that you have no other application in another .NET version running in the same pool. 重要的是,在同一池中运行的另一个.NET版本中没有其他应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM