Base solution for your next web application
Open Closed

aws elastic beanstalk - error on publish #8229


User avatar
0
Siyeza created

see the error below, please help.

System.UnauthorizedAccessException: Access to the path 'C:\inetpub\AspNetCoreWebApps\app\tempkey.rsa' is denied. at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path) at System.IO.File.WriteAllText(String path, String contents) at Microsoft.Extensions.DependencyInjection.IdentityServerBuilderExtensionsCrypto.AddDeveloperSigningCredential(IIdentityServerBuilder builder, Boolean persistKey, String filename, RsaSigningAlgorithm signingAlgorithm) at insureserve.Web.IdentityServer.IdentityServerRegistrar.Register(IServiceCollection services, IConfigurationRoot configuration, Action1 setupOptions) in C:\Local Development\insureserve3.0\insureserve\src\insureserve.Web.Core\IdentityServer\IdentityServerRegistrar.cs:line 15 at insureserve.Web.Startup.Startup.ConfigureServices(IServiceCollection services) in C:\Local Development\insureserve3.0\insureserve\src\insureserve.Web.Mvc\Startup\Startup.cs:line 87 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection) at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder1.<>c__DisplayClass15_0.<BuildStartupServicesFilterPipeline>g__RunPipeline|0(IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services) at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services) at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi @siyeza

    AddDeveloperSigningCredential method need write tempkey.rsa file to current directory.

    It can be seen from the logs that the application does not have permission to do so.

  • User Avatar
    0
    Siyeza created

    hi @maliming, I saw that. However I do not know where or how to do that. This link below, do I need to do something like this? Or perhaps if you have a link that I can look at on how to do this?

    https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/src/Configuration/DependencyInjection/BuilderExtensions/Crypto.cs

  • User Avatar
    0
    maliming created
    Support Team

    hi siyeza

    I have no experience with aws elastic beanstalk.Or can you copy the tempkey.rsa file into your website?

  • User Avatar
    0
    Siyeza created

    forget about this one (i am now on azure with another issue). please refer to the ticket number. #8240