Skip to content

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:

2016-10-04_15-47-15

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

2016-10-04_15-54-36

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.

2016-10-04_15-57-24

Screen 3

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

2016-10-04_16-00-34

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

2017-01-27_14-42-06

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

2017-01-27_14-46-35

“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:

2016-09-20_16-45-31

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:

 

2016-09-14_14-21-44

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:

2016-09-07_10-06-53

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:

https://web.archive.org/web/20130424225355/http://theruntime.com/blogs/brianpeek/archive/2007/11/13/x64-development-with-net.aspx

http://stackoverflow.com/questions/270531/how-to-determine-if-a-net-assembly-was-built-for-x86-or-x64

https://msdn.microsoft.com/en-us/library/ms164699(v=vs.110).aspx

 

 

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$\
    2016-08-23_8-55-25
  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$\
    2016-08-23_8-55-12

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: https://visualstudiogallery.msdn.microsoft.com/898a828a-af00-42c6-bbb2-530dc7b8f2e1.

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:

2016-07-22_11-53-06

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

Click Yes on a popup dialogue.

2016-07-22_14-05-58

 

Rolling back to a specific version in TFS

You should use this, if you have multiple changesets for a file in TFS and you need to rollback to a specific version. For example, you had a file at a changeset 1 first. Then you have checked in some changes with the changeset 2. Then you checked in more changes with the changeset 3. Now you need to rollback the file to the version it was when only changeset 1 was checked in. Here is how:

  1. Open Source Control Explorer in Visual Studio and navigate to the file of interest.
  2. Right-click on the file and select Rollback…2016-07-22_10-04-21
  3. In the context menu select “Rollback to a specific version:” option.
  4. Select a changeset that you want to rollback to and click “Rollback”.