views:

24

answers:

1

I'm new to IIS 7.5 (Window 7)

If while I new ASP.NET 3.5 Website target it on Local IIS , it works without any problem . But if i new a file-system ASP.NET 3.5 Website and from IIS add that website and configure it , It doesn't work . I get this error

In order to work I had to comment these following lines

<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">
          <!--<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>-->
          <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <!--<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />-->
            <!--<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
            <!--<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
            <!--<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />-->
          </sectionGroup>
        </sectionGroup>
      </sectionGroup>

I'm wondering why should i comment those lines while it isn't necessary for the first way?

Thank you

Edit :

When i say First way , I mean when creating a webiste , I chose "Http" instead of "File System" in Weblocation drop downlist . and target it on IIS not webserver provided with Visual Studio

+1  A: 

As the error states, it is because they are duplicate (the same tags are defined somewhere else aswell). It could either be that they are already somewhere else in your own file, which is probably not so likely, or they could also be in machine.config, or in another web.config file in a parent folder.

klausbyskov
most likely a parent config. I'm also curious if this has all the latest .NET updates installed.
drachenstern
@Klaus: You answer fit my question which i stated in the title . It's a hello word project ( Just one aspx and webconfig file ) and it's more probably true that it's duplicated in machine.config . But my question is why the first option works fine ?
Mostafa
@drachenstern : I use VS 2010 and Windows 7 64bit , Should i install some thing else ?
Mostafa
@Mostafa, yes. Install Mac OSX. Just kidding ;-)
klausbyskov
@Mostafa ~ I thought you were running this on IIS 7.5 on Windows Server ... Windows 7(64) with all updates shouldn't have this problem. Are you sure all the components for IIS7.5 are installed?
drachenstern
@Mostafa ~ The reason it works fine is because the webserver provided with Visual Studio is not as full-featured as IIS (think configurations and virtual directories and app-pools and multiple site handlers all in one place, etc) and is dedicated to testing code, so probably has better hooks in place for making sure that the necessary includes are available. That's why it runs differently in each environment.
drachenstern
I think i couldn't get it across , When i say first option , I don't mean webserver provided with VS , I mean when create a webiste , I chose "Http" instead of "File System" in Weblocation drop downlist . and target it on IIS
Mostafa