Could not load file or assembly Microsoft.IdentityModel

Created:

2016-11-16 13:04:34 UTC

Modified:

2017-04-24 11:04:14 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Could not load file or assembly Microsoft.IdentityModel

Applicable to:

  • Plesk 12.5 for Windows

Symptoms

The following error can be observed in Plesk:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.

Full exception stack trace:
DotNetNuke.Services.Exceptions.PageLoadException: The type initializer for 'System.Web.Helpers.AntiForgery' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Web.Helpers.AntiForgery' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Web.Helpers.Claims.ClaimsIdentityConverter' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.

ASP.NET website is not loading after Plesk upgrade. The following error being shown in web browser locally:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.
Source Error:

Line 35: <add assembly="System.DirectoryServices.AccountManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Line 36: <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 37: <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 38: <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 39: <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

Source File: C:\\Inetpub\\vhosts\\example.com\\httpdocs\\web.config Line: 37
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

Cause

Broken permissions on file Microsoft.IdentityModel.dll located in C:\\Windows\\WinSxS\\msil_microsoft.identitymodel_31bf3856ad364e35_6.3.9600.16384_none_0abcbf18d8ddae5d\\ .

This is Plesk bug with ID #PPPM-5020 that is planned to be fixed in future Plesk updates.

Workaround

Add the following entries to %plesk_dir%\\etc\\DiskSecurity\\DiskSecurity.xml file:

       <Entry AccounType="1" Account="Psaadm" Path="{ProgramFilesX86}" SubPath="Reference Assemblies" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="NoAccess" EntryFlags="0" />
<Entry AccounType="1" Account="Psacln" Path="{ProgramFilesX64}" SubPath="Reference Assemblies" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="NoAccess" EntryFlags="0" />
<Entry AccounType="1" Account="Psaadm" Path="{ProgramFilesX64}" SubPath="Reference Assemblies" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="NoAccess" EntryFlags="0" />

after the following one:

   <!-- Program Files\\Reference Assemblies -->
<Entry AccounType="1" Account="Psacln" Path="{ProgramFilesX86}" SubPath="Reference Assemblies" AceFlags="ThisFolderSubfoldersAndFiles" AccessMask="NoAccess" EntryFlags="0" />
Have more questions? Submit a request
Please sign in to leave a comment.