• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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