• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue [.NET Core] Misleading error: Could not load file or assembly 'Microsoft.IdentityModel.Protocols, Version=7.1.2.0'

asalas

New Pleskian
Server operating system version
Windows
Plesk version and microupdate number
18.0.65
Hi everyone,


I'm hosting a .NET Core API on a Plesk server (Windows hosting, IIS), and my application is failing to start.
The logs show the following error:


"Could not load file or assembly 'Microsoft.IdentityModel.Protocols, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified."


However, I’m fairly certain this is a misleading message. I’ve faced this issue before and it was not actually caused by this DLL. The file is present in the published output, and locally everything works fine.


Context:​


  • .NET version used: [.NET 8]
  • Publish mode: [Framework-dependent / Self-contained]
  • Hosting mode: In-process
  • Application runs fine locally and on other environments.

What I’ve tried:​


  • Verified that the DLL exists in bin and publish folder.
  • Server has matching .NET runtime installed.
  • Increased logging detail, but stack trace still points to the missing DLL.
  • Suspecting the real problem lies deeper (e.g., broken dependency, runtime incompatibility, or JWT setup).

Questions:​


  1. Has anyone encountered this error on Plesk and found the root cause was unrelated to the DLL?
  2. Is there a way to get deeper logging (for example, module load failures or inner exceptions during startup)?
  3. Any Plesk-specific configuration that could interfere with how .NET loads assemblies?

Any insights or tips would be appreciated. Thanks in advance!
 
Assuming you have the Windows Identity Foundation installed or the IdentityModel added to your solution you might need to add the following:

XML:
<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" />

Below

XML:
<!-- Program Files\\Reference Assemblies -->
<Entry AccounType="1" Account="Psacln" Path="{ProgramFilesX86}"
SubPath="Reference Assemblies" AceFlags="ThisFolderSubfoldersAndFiles"
AccessMask="NoAccess" EntryFlags="0" />

In the file %plesk_dir%\etc\DiskSecurity\DiskSecurity.xml.

Source: Could not load file or assembly 'Microsoft.IdentityModel
 
Thank you very much for your response!


In my case, I purchased the hosting service through another provider (not directly from Plesk). Would it be possible for me to ask them to perform this modification, or should they contact you to enable access to this section?


Thanks again for your help.
 
Pleak doesn't offer hosting services to begin with. If you have full access to your Pleak instance you usually have full RDP access to the server as well. If you do not know if you do or not please reach out to your host provider for assistance.
 
Back
Top