Hi
I published aspnetzero demo project to our test environment. When I call the web.mvc project from browser I get following error. The log file is below. There is no tempkey.rsa file in published files.
Application startup exception: System.UnauthorizedAccessException:** Access to the path 'C:\inetpub\wwwroot\dashboard\tempkey.rsa' is denied.** at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at Microsoft.Extensions.DependencyInjection.IdentityServerBuilderExtensionsCrypto.AddDeveloperSigningCredential(IIdentityServerBuilder builder, Boolean persistKey, String filename) at AutoSenseDemo.Web.IdentityServer.IdentityServerRegistrar.Register(IServiceCollection services, IConfigurationRoot configuration) at AutoSenseDemo.Web.Startup.Startup.ConfigureServices(IServiceCollection services) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() Hosting environment: Production Content root path: C:\inetpub\wwwroot\dashboard Now listening on: http://127.0.0.1:43126 Application started. Press Ctrl+C to shut down.
6 Answer(s)
-
0
Does the file C:\inetpub\wwwroot\dashboard\tempkey.rsa exist? Looks like a problem with iis.
-
0
hi
There is no temkey.rsa file in published files.
-
0
Sorry, I feel like a IIS permission issue. The application does not have permission to create new files.
Try to manually copy the tempkey.rsa file generated during development to the IIS website directory.
https://stackoverflow.com/questions/48933369/access-denied-file-in-asp-net-core?rq=1
-
0
It works thank you
-
0
-
0
Hi @kansoftware
This file is used by IdentityServer. If you don't use IdentityServer, you can disable it in appsettings.json file. If you are using it, you need to provide write access to your app for the mentioned folder. I'm not sure how to do that in AWS.