IIS7到IIS6迁移web.config问题

发布于 2024-12-03 02:40:28 字数 1158 浏览 1 评论 0原文

我有一个在 Visual Studio 2008 中编写的针对 .Net Framework 3.5 的 Web 应用程序。为了测试它,我使用了运行 Windows 7(即 IIS7)的计算机。我的应用程序在此工作正常,但当它部署到开发服务器(运行服务器 2003,因此 IIS6)时,它无法工作。

我的 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">

我收到的错误与sectionGroup 标记的 type= 部分有关。我不记得确切的消息,但它类似于“无效标签”或“无效属性”。

我有两个问题:

  • 首先,是否有人对 IIS 足够精通,知道为什么它在 7 中有效,而在 6 中无效?
  • 其次,为什么需要sectionGroup标签?它有什么作用?

我检查了开发服务器以确保安装了正确版本的 .net。它有 2、3、3.5 和 4,所以我应该在这方面进行介绍。

我对 .net 还很陌生(现在可能已经很明显了),所以如果这个问题已经被问了一千遍并且看起来我已经死马了,请原谅我。我的谷歌搜索和 stackoverflow 搜索没有提供解决方案。

解决方案: 整个问题是 IIS 配置不正确。网站属性的 asp.net 选项卡设置为 2.0.something。我们将其更改为 4.0.something(3.5 不是一个选项),一切正常。

I have a web application that I wrote in Visual Studio 2008 that targets .Net Framework 3.5. To test it I used a machine running Windows 7, which means 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.

The first few lines of my web.config file are as follows:

<?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. 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?
  • Second, why do I need the sectionGroup tag? What does it do?

I checked the dev server to make sure the right version of .net was installed. It has 2, 3, 3.5, and 4, so I should be covered on that front.

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. My googling and searching of stackoverflow didn't provide a solution.

SOLUTION:
The whole problem was IIS not being configured correctly. The asp.net tab of the website's properties was set to 2.0.something. We changed it to 4.0.something (3.5 wasn't an option) and everything works just fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

财迷小姐 2024-12-10 02:40:28

您的框架面向 .NET 3.5。是否使用脚本部分可能并不重要,但脚本部分是用 3.5 配置的。这用于 ASP.NET Ajax 脚本的客户端脚本。

如果您在 IIS 6 中运行应用程序,则取决于您为应用程序池配置的框架版本。如果您混合应用程序,它可能会以错误的版本启动。检查您的池配置是否正确。不幸的是,我这里没有 IIS 6,我不记得你是如何做到这一点的。重要的是,同一池中没有运行其他 .NET 版本中的其他应用程序。

Your framework targets .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. This is used for the client scripts of the ASP.NET Ajax Scripts.

If you run your application in IIS 6, it depends on which framework version you have configured for the application pool. 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. Important is that you have no other application in another .NET version running in the same pool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文