Open Closed

AbpInitializationException #2797


User avatar
0

So, working on integrating abp with a WPF app (based on my sample here https://github.com/kfrancis/abp-wpf), I'm working on creating a Windows Application Packaging Project to install the WPF app, ultimately I want to deploy through appcenter.ms which requires appx/msix to distribute the app.

  • ABP Framework version: v5.1.3

The app works great, but after creating the installer it seems to be getting confused about the directory when it comes to some of the modules like AbpIdentityServerDomainModule in this case. When running AbpApplicationFactory.CreateAsync

Volo.Abp.AbpInitializationException
  HResult=0x80131500
  Message=An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.IdentityServer.AbpIdentityServerDomainModule, Volo.Abp.IdentityServer.Domain, Version=5.1.3.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
  Source=Volo.Abp.Core
  StackTrace:
   at Volo.Abp.AbpApplicationBase.<ConfigureServicesAsync>d__23.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at Volo.Abp.AbpApplicationFactory.<CreateAsync>d__0`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at CabMD.McedtAdminWpf.Core.ApplicationBootstrapper.<InitializeIfNeedsAsync>d__6`1.MoveNext() in C:\Projects\CabMD15\aspnet-core\src\CabMD.McedtAdminWpf\Core\ApplicationBootstrapper.cs:line 25

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
UnauthorizedAccessException: Access to the path 'C:\Windows\system32\tempkey.jwk' is denied.

So, is there an option that I can tell it the correct directory Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) in this case?

To reproduce:

  1. Clone the abp-wpf sample
  2. Add a WAP project
  3. Try to run the WAP project.

Expected: The app should run normally. Actual: An exception occurs during module initialization.


3 Answer(s)
  • User Avatar
    0

    I understand that most aren't using WPF, but all of this would be relevant to WinUI/UWP as well - anything that would be deployed as a standalone app.

  • User Avatar
    0

    I think the issue is with this line:

    filename = Path.Combine(Directory.GetCurrentDirectory(), "tempkey.rsa");
    

    https://github.com/abpframework/abp/blob/e3e1779de6df5d26f01cdc8e99ac9cbcb3d24d3c/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderExtensions.cs#L76

    Need to use an option there, or find some way to specify filename so that the GetCurrentDirectory isn't used in this context.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @kfrancis@@clinicalsupportsystems.com

    This was configured for Web application at the first time, but you're right, it might be a problem in that case. We'll work on it.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11