简体   繁体   中英

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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