IIS complains about a locked section - how can I find out where it's locked?

From here: http://serverfault.com/questions/360438/iis-complains-about-a-locked-section-how-can-i-find-out-where-its-locked

I have this section in my web.config:
    <modules runAllManagedModulesForAllRequests="true" />
            <anonymousAuthentication enabled="true" />
            <windowsAuthentication enabled="true" />

IIS7 crashes and complains about the autientication section:

Module AnonymousAuthenticationModule
     Notification   AuthenticateRequest
     Handler    StaticFile
     Error Code 0x80070021
     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".

How to Fix.
1.Open IIS Manager
2.Click the server name in the tree on the left
3.Right hand pane, Management section, double click Configuration Editor
4.At the top, choose the section system.webServer/security/authentication/anonymousAuthentication
5.Right hand pane, click Unlock Section
6.At the top, choose the section system.webServer/security/authentication/windowsAuthentication
7.Right hand pane, click Unlock Section




IIS FTP Passive Mode

I ran into an issue today with my FTP PowerShell script not working. It was configured to use port 21 as it has for years. The FTP site is at my son's house and he just got a new modem when he changed his provide to Telus. I found out that Telus block port 21 so I changed it to port 22, however then ran into a PASV (passive mode) issue where it would not upload files. After several hours I figured out that I needed to set the internal router to allow ports 49152-65534 in and then also had to do the same in IIS under the FTP site as well as set the Exteranl IP Address of Firewall to the IP address of the modem/router.

I found help here if the like still works: http://stackoverflow.com/questions/21032577/how-use-passive-mode-in-ftpwebrequest-fix-pasv-error-in-net-3-5-define-port/21051211#21051211

Microsoft JScript runtime error: RSClientController is undefined

From this site! http://geekswithblogs.net/WesWeeks/archive/2009/01/21/128874.aspx

Running Windows Vista 64 bit, Sql Server 2008 on a remote server. Using ASP.Net and the Report Viewer control on an asp.net page for a local report. Was also using IIS to host the web site instead of using the web server built into Visual Studio 2008.

Searched and tried everything I could find on the net trying to fix this freaking error. On a whim (and because I didn't know what else to do and was trying everything I could think of) changed the IIS 7.0 app pool to the classic app pool. Angels came singing down from the sky and my report worked.

What a PITA! Hope this post helps someone else.

VS 2010 Unable to automatically step into the server

If you need to debug a WCF Server, or somehow need to step into code on IIS, you will need to do the following to prevent the message  “Unable to automatically step into the server. Unable to determine a stopping location”. The message might be slightly different but generally it means you can't debug in IIS!

It turns out that Visual Studio 2010 comes with a default setting to debug ‘Just my code’.

To correct the problem, go to Tools – Options – Debugging – General and switch off the option ‘enable just my code’.  

And of course don’t forget to set debug="true" in the web.config file of the webservice. Double check your publishing Transformations too if using any, as that might be removing the debug="true" property in your web.Config file.

This will hopefully help someone else out there!

HTTP to HTTPS Redirect on IIS7

Redirecting all HTTP traffic to HTTPS for a single site on IIS7 is as simple as the following steps.

1. Install Microsoft URL Rewrite Module if not already installed

2. Install your SSL certificate as Normal.
(Note that you need to keep a hostname-less port 80 entry in the Bindings, as well as port 443 for SSL, in order for the redirect to work.)

3. Add the following XML to your Web.Config file. 

      <rule name="HTTP to HTTPS redirect" stopProcessing="true">
        <match url="(.*)" />
          <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />


5. Test the URL to ensure http redirects to https. Also test not entering a http at all, just the website host name.

6. Done.

How to Fix "PageHandlerFactory-Integrated" bad module "ManagedPipelineHandler in IIS7

Run "aspnet_regiis.exe" program from command line (within Command Prompt):

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i

If you want to open it using the Run program, just type in "Run" in the Windows 7 search box, then use the following line below in the Open box, then click OK:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i

Note if your computer is 64 bit, then I would change the line to:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –i

Hopefully, these solutions help get you up and running and fix the IIS7 error... Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.

IIS 7.x Timeout when Debugging in Visual Studio

If you are annoyed at the IIS timeouts when running .NET code via Visual Studio then you'll want you know how to fix that problem!

You can do 1 of 2 things.
* Go to the Application Pool for the Web Application you are working with. Select the Advanced Settings. Set the Ping Enabled property to False. This will allow you debugging to run forever.
* If you prefer to allow IIS to continue the monitoring process then change the Ping Maximum Response Timeout value to something larger than 90 seconds (default value).


aspnet_regiis -ga domain\user

I was trying to run "aspnet_regiis -ga domain\user" from the command prompt today, but it wouldn't work! I was trying to add calsvdafran03\VSeWSS local user to IIS 7.0 on Windows 2008 Server so that I could take advantage of Visual Studio 2008 extensions for Windows SharePoint Services 3.0, v1.3. The 64 bit version that is. Anyway, I ran into difficulties running it and then discovered that I had to navigate to the C:\Windows\Microsoft.NET\Framework64\v2.0.50727 directory in order to successfully execute the command.