Dave's Technophorical Times

A blog about Microsoft's Technologies!
SharePoint :: MVC :: ASP.NET :: IIS :: SQL Server :: Visual Studio :: MS Access

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:
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <security>
        <authentication>
            <anonymousAuthentication enabled="true" />
            <windowsAuthentication enabled="true" />
        </authentication>
    </security>
</system.webServer>

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

 

 

 



Nov
06

IIS FTP Passive Mode

by Dave Stuart | Tags:

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



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.



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!



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. 

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

4. Do a IISRESET

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.



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.



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

 



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.

 



The Blogger

Dave Stuart I'm a Developer with a passion for coding. I enjoy the challengers that come with the job! SharePoint is one of my expert areas along with .NET Web Development with MVC and good old MS Access VBA coding. I Blog so that I can remember how I did that way back when; PLUS all this stuff is searchable! I constantly study and run my own business, Dafran Inc. I have passed 22 Microsoft Exams since 1998 when I first jumped on the treadmill of knowledge. I hope that you enjoy this Blog as much as I enjoy updating it. All the very best from Calgary, Alberta, Canada. contact me at linkedin @ dafran.ca

Calendar

<<  September 2017  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

View posts in large calendar

Sign in