• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

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