« Previous Next »

Thread: appcmd unlock fails

Last post 05-06-2007 12:26 AM by anilr. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 04-27-2007, 10:25 AM

    appcmd unlock fails

    I just installed Beta 3 and wanted to (as always) try the directory listing sample. So I went ahead and tried to unlock the <modules> section to allow the sample to run. However, I got this error:

    C:\Windows\System32\inetsrv>appcmd unlock config /section:modules
    ERROR ( message:Configuration error
    Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config
    Line Number: 0
    Description: The configuration section 'modules' cannot be read because it is mi
    ssing a section declaration
    . )

    What is it trying to tell me? I simply copied the command from http://www.iis.net/954/SinglePageArticle.ashx and applied it to the modules section.

    Chris 

  • 04-27-2007, 2:02 PM In reply to

    Re: appcmd unlock fails

    try this:

     

    appcmd.exe unlock config /section:system.webserver/modules

     

    Also, you can see a list of sections with this command

     appcmd.exe unlock config /section:?

     

    -bretb
    IIS Critical Problem Resolution
    Microsoft Corp.
  • 05-04-2007, 7:17 PM In reply to

    • KristinLaura
    • Not Ranked
    • Joined on 01-18-2006, 11:26 PM
    • Sacramento, CA
    • Posts 2

    Re: appcmd unlock fails

    I'm running IIS 7 on Vista Home Premium.  I get the following error when I try to open an ASP.NET app in IE7.  I tried using the appcmd.exe to unlock the handlers section, but I get "cannot read configuration file" error.  I searched my system for applicationHost.config and can't find it.  Is this possible?

    Thanks -- Kristin


    HTTP Error 500.19 - Internal Server Error

    Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

    Error Code: 0x80070021

    Notification: BeginRequest

    Module: IIS Web Core

    Requested URL: http://localhost:80/

    Physical Path: C:\Users\Kristin\Documents\Visual Studio 2005\Projects\Website

    Logon User: Not yet determined

    Logon Method: Not yet determined

    Handler: Not yet determined

    Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

    Config File: \\?\C:\Users\Kristin\Documents\Visual Studio 2005\Projects\Website\web.config

    Config Source:

      219:     </modules>
      220:     <handlers>
      221:       <remove name="WebServiceHandlerFactory-Integrated"/>
    

    More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.


    Server Version Information: Internet Information Services 7.0.

  • 05-05-2007, 2:34 AM In reply to

    Re: appcmd unlock fails

    The applicationHost.config file is in c:\windows\system32\inetsrv\config  I would verify IIS is completely installed.

    http://technet2.microsoft.com/windowsserver/en/library/86026b03-18b0-4c42-9884-5af83226e2bd1033.mspx?mfr=true

    or look in Control Panel > Programs / Features > Internet Information Server.

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 05-05-2007, 3:50 PM In reply to

    • KristinLaura
    • Not Ranked
    • Joined on 01-18-2006, 11:26 PM
    • Sacramento, CA
    • Posts 2

    Re: appcmd unlock fails

    Thanks.  I found the file and was able to make the following modifications:

    <section name="handlers" overrideModeDefault="Allow" />
    <section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />

    This eliminated the 500.19 errors, but know I'm getting the following 404.3 error about MIME types. Am I really supposed to be modifying my config files and adding MIME types just to get an ASP.NET app to run on IIS7. It works fine on IIS6.


    Server Error in Application "Default Web Site"

    HTTP Error 404.3 - Not Found

    Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.

    Error Code: 0x80070032

    Notification: ExecuteRequestHandler

    Module: StaticFileModule

    Requested URL: http://localhost:80/professionals.aspx

    Physical Path: C:\Users\Kristin\Documents\Visual Studio 2005\Projects\Website\professionals.aspx

    Logon User: Anonymous

    Logon Method: Anonymous

    Handler: StaticFile

    Most likely causes:

    • It is possible that a handler mapping is missing. By default, the static file handler processes all content.
    • The feature you are trying to use may not be installed.
    • The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)

    What you can try:

    • In system.webServer/handlers:
    • Ensure that the expected handler for the current page is mapped.
    • Pay careful attention to preconditions (e.g. runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.
    • Pay careful attention to typographical errors in the expected handler line.
    • Please verify that the feature you are trying to use is installed.
    • Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.
      1. Open a command prompt and change directory to %windir%\system32\inetsrv.
      2. To set a MIME type, use the following syntax: appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']
      3. The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
      4. For example, to add a MIME map for a file which has the extension ".xyz", type the following at the command prompt, and then press Enter:
      5. appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
      Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.
    • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

    More Information...

    This error occurs when the file extension of the requested URL is for a MIME type that is not configured on the server. You can add a MIME type for the file extension for files that are not dynamic scripting pages, database, or configuration files. Process those file types using a handler. You should not allows direct downloads of dynamic scripting pages, database or configuration files.

     


     

    Server Version Information: Internet Information Services 7.0.

     

     

     

     

     

     

     

     

     

     

  • 05-06-2007, 12:26 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: appcmd unlock fails

    You do not want to add .aspx to the mime-maps, this would cause source for .aspx pages to be downloaded, not the thing you want - you need to go into the "Add/Remove windows component" UI and install asp.net - this will add the appropriate handler entries for asp.net - this would have also taken care of unlocking the modules and handlers sections.
    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (6 items)
Microsoft Communities