• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue ASP.net Core UnauthorizedAccessException: Access to the path

AKACO

New Pleskian
Hi

,
I just upload my project on Plesk but I getting some error :
The login system is working fine on my development machine but when I publish it to my hosting environment it gives me this error:
UnauthorizedAccessException: Access to the path 'C:\Windows\system32\config\systemprofile\AppData\Local\ASP.NET\DataProtection-Keys' is denied.
I'm not sure where is the setting for IIS Application Pool
I talked to the hosting provider they said they gave me the full rights to the everywhere.
a9d5bfd2-1649-11e7-934b-ed32f3dffe6e.png

Thank you in advance.
 
Is this ASP.NET Core 1.0 application? or 1.1?

Key management and lifetime
According to documentation, there are several places where DataProtection Keys can be stored.

In ASP.NET 1.1 application you can configure your application to store these Data Protection Keys in location that is accessible by IIS application pool identity.
Configuring Data Protection

If you can't modify your application, or don't want to dive that deep into code, you can try to configure permissions to registry hive for your application pool identity.
In this case ASP.NET Core will store your Data Protection Keys in registry hive.
For that you need to know system user used as IIS application pool identity (IWPD_X(something), for example) and launch the following command line:

"%plesk_bin64%\aspnetcoremng.exe" --create-data-protection-hive --user-name=<IIS application pool identity>
 
Back
Top