I was trying to deploy an IdentityServer 4 app with ASP.NET core 2.2 into IIS in my local machine (Windows 10) and get the error:
An error occurred while starting the application. UnauthorizedAccessException: Access to the path 'c:\windows\system32\inetsrv\tempkey.rsa' is denied."
Its working with debugging mode but getting above while deploying in IIS.
Identity server 4 version - 2.3.2
Asp.net core 2.2
IIS 10.0.16
Can anyone help to solve this?
I had the same error and it was coming from the call to AddDeveloperSigningCredential()
inside configure services. When I changed it to AddDeveloperSigningCredential( persistKey: false )
, the error went away.
Here is entire function call block
public void ConfigureServices( IServiceCollection services )
{
services.AddIdentityServer()
.AddDeveloperSigningCredential( persistKey:false)
.AddInMemoryApiResources( Config.GetApiResources() )
.AddInMemoryClients( Config.GetClients() );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With