Skip to content

HTTP Error 401.2 – Unauthorized

When trying to debug the web application in IIS Express on the development machine, we received the following error from IIS:


Our application was designed to use Windows Authentication. As the help article indicated at the bottom of the page advises, we opened IIS and needed to adjust Windows Authentication settings:


It turns out, that there was no Windows Authentication section.


To fix this open Control Panel -> Programs and Features -> Turn Windows Features on or off. Select “Windows Authentication” from the following category:


This same problem would apply to other Authentication types in IIS.




HTTP Error 500.19 in the IIS Express

When trying to debug the website from Visual Studio 2015 using IIS Express the following error was reported by the web-server:


Screen 1

The “Config Error” section says: “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”. 

When this error occurs on the standalone IIS server, the following error codes is logged in the log file: 500 19 33 [xx] where xx can have different values, for example 2761, 15, 6255, 46, 31  etc.

This means that this configuration section is locked in IIS (in this case it was IIS Express). Let’s check and unlock it.

1. Open IIS, select the server node from the Connections window and click Configurations Editor in the Features View


Screen 2

2. In the IIS configuration editor, in the Section drop down navigate to system.webServer/security/authentication/windowsAuthentication. This was the problematic section that was included in the error message on Screen 1 in Module section.


Screen 3

3. Click Unlock Section in the Actions menu on the right side.


Screen 4

This will unlock this section and the changes from web.config of your application will have effect on the website created by the IIS Express.

The alternative way of fixing this issue is to:

1. Open IIS, select the server node from the Connections window and click Feature Delegation in the Features View


2. Select the feature “Authentication – Windows” and change the Delegation setting to Read\Write instead of Read Only.


“Extracting” .dll file from Global Assembly Cache (GAC)

This can be done using Windows PowerShell. Open PowerShell and navigate to the location of the .dll file. In this particular case the .dll that we needed to extract was added as a reference to one of the projects in Visual Studio. When we checked the properties of a reference, the Path property was set to C:\WINDOWS\assembly\GAC\ADODB\7.0.3300.0__b03f5f7f11d.

So in PowerShell navigate to this location:


then run the following command:

copy-item adodb.dll c:\temp

This will copy the adodb.dll file to c:\temp folder.

IIS logs 500 0 0 15 error for the application.

The other day I was debugging the application that was not working after we hosted it in IIS. The log files included the following line:



It turned out that there was an error in the application. Application was throwing an exception. After the error in the application was fixed the web app worked perfectly.


How to determine if a .NET assembly was built for x86 or x64?

The CorFlags.exe Conversion tool (automatically installed with Visual Studio, can be found in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin) allows you to configure the CorFlags section of the header of a portable executable image.

You can also run this tool to find out the information about the assembly or executable. For example, if you have a .dll in the following location D:\MyProjects\my.dll

Open command prompt and navigate to the folder that has CorFlags.exe. Once in the folder run the following command:

corflags D:\MyProjects\my.dll

The example output:


Here is the table that decodes that information: (source)

CLR Header NOT the version of the CLR the file is compiled for
2.0 = .NET 1.0 or 1.1
2.5 = .NET 2.0
PE PE header type
PE32 = 32-bit
PE32+ = 64-bit
CorFlags Various flags for endian type, ILONLY, etc.
ILONLY The file contains IL only (i.e. no unsafe code)
32BIT 1 = x86 target
0 = Any CPU target
Signed 1 = Assembly signed
0 = Assembly not signed

mapping of targets to flags:

Any CPU PE32 with 32BIT = 0
x86 PE32 with 32BIT = 1
x64/Itanium (IA-64) PE32+ with 32BIT = 0


This information has been taken from the following sources:



Delete File(s) or Folder Action in VS Release Management

When using Visual Studio Release Management for the applications deployment, the action Delete File(s) of Folder offers the ability to have files and/or folders deleted. Here is how you can use:

  1. To delete everything inside the specific folder, use “*” token after the address of the folder, for example indicating the following address \\devserver\ApplicationFolder$\* will delete all files and folders inside the folder \\devserver\ApplicationFolder$\
  2. To delete only files inside the specific folder, use “*.*” token after the address of the folder, for example indicating the following address \\devserver\ApplicationFolder$\*.* will delete all files but not folders inside the folder \\devserver\ApplicationFolder$\

How to undo the checkout by other users in TFS.

If you are in a role of TFS admin, there sometimes is a need to undo the checkout by other users, i.e. someone has checked out the file but is not available to check the file back in.

To be able to perform this operation from the UI, you need to install the Microsoft Visual Studio Team Foundation Server Power Tools. The version of tools that you need will depend on the Visual Studio version that you are running. Here is the link for the 2015 version:

After downloading and installing the Power Tools, launch the Visual Studio and navigate to the folder that contains the files you need to undo the checkout for. Right-click the folder and Expand the Find menu. With Power Tools installed, you should now see the option “Find by Status…”. Click it. make sure “Display all checked out” option is selected for “Status” and click Find.

This will bring up another screen:


Select the file that you want to unlock, right-click on it and select “Undo…” option.

Click Yes on a popup dialogue.