Activities of "Jesse.Thomas@condoauthorityontario.ca"

Hi,

Please see code below:

public class EmailDefinitionTemplateProvider : TemplateDefinitionProvider
{
    public const string SubjectPropertyName = "Subject";
    public const string DescriptionPropertyName = "Description";
    private const string DefaultEmailLayout = "EmailLayout";
    public const string NotesPropertyName = "Notes";


    public override void Define(ITemplateDefinitionContext context)
    {
        if (context != null)
        {
            context.Add(
                new TemplateDefinition(
                    DefaultEmailLayout,
                    isLayout: true
                ).WithVirtualFilePath(
                    $"/Emailing/Templates/{DefaultEmailLayout}.tpl", //template content path
                    isInlineLocalized: true
                ).WithScribanEngine()
            );

            foreach (var emailCode in Enum.GetValues(typeof(EmailCode)))
            {
                context.Add(
                    new TemplateDefinition(
                            name: emailCode.ToString(),
                            defaultCultureName: CatOsConsts.CultureNameEn,
                            layout: DefaultEmailLayout //Set the LAYOUT
                        ).WithScribanEngine()
                        .WithVirtualFilePath(
                            $"/Emailing/Templates/{emailCode}", //template content folder
                            isInlineLocalized: false
                        )
                        .WithProperty(SubjectPropertyName, L($"MailType:{emailCode}:MailSubject"))
                        .WithProperty(DescriptionPropertyName, L($"MailType:{emailCode}:MailDescription"))
                        .WithProperty(NotesPropertyName, L($"MailType:DEFAULT:MailNote")) 
                );
            }
        }
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<EmailResource>(name);
    }

In the code above we are using the ABP implementation for Template management. The solution works fine locally (in Visual Studio), however after deployment to Azure App Service, we are getting the following error:

Error Message: Could not find a file/folder at the location: /Emailing/Templates/CAT_INV_W

We have traced it back to this line of code above:

         ).WithVirtualFilePath(
                        $"/Emailing/Templates/{DefaultEmailLayout}.tpl", //template content path

It appears the virtual file path is not working on Azure, and we are not sure how to fix it. Can you please let us know if there is something we need to configure to allow Virtual File Paths to work with the ABP Framework on Azure?

If you can guide us to the right documentation or help us resolve this issue that would be greatly appreciated.

Thanks,

Jesse

ABP Framework version: v4.4.2 UI type: Blazor Server DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): no Exception message and stack trace:

Error Message: Could not find a file/folder at the location: /Emailing/Templates/CAT_INV_W

Stack trace:
Volo.Abp.AbpException:
at Volo.Abp.TextTemplating.VirtualFiles.LocalizedTemplateContentReaderFactory+<CreateInternalAsync>d__9.MoveNext (Volo.Abp.TextTemplating.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.TextTemplating.VirtualFiles.LocalizedTemplateContentReaderFactory+&lt;CreateAsync&gt;d__8.MoveNext (Volo.Abp.TextTemplating.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.TextTemplating.VirtualFiles.VirtualFileTemplateContentContributor+<GetOrNullAsync>d__3.MoveNext (Volo.Abp.TextTemplating.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.TextTemplating.TemplateContentProvider+<GetContentOrNullAsync>d__11.MoveNext (Volo.Abp.TextTemplating.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.TextTemplating.TemplateContentProvider+&lt;GetContentOrNullAsync&gt;d__9.MoveNext (Volo.Abp.TextTemplating.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter.GetResult (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.TextTemplateManagement.TextTemplates.TemplateContentAppService+<GetAsync>d__5.MoveNext (Volo.Abp.TextTemplateManagement.Application, Version=4.4.2.0, Culture=neutral, PublicKeyToken=null)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Castle.DynamicProxy.AsyncInterceptorBase+<ProceedAsynchronous>d__14`1.MoveNext (Castle.Core.AsyncInterceptor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e33b67d3bb5581e4)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1+<ProceedAsync>d__7.MoveNext (Volo.Abp.Castle.Core, Version=4.4.2.0, Culture=neutral, PublicKeyToken=null)

Hi,

I am trying to call a service in the Volo Language management module via a background process. When I attempt to do this I get 'Volo.Abp.Authorization.AbpAuthorizationException' error.

It appears I can not call the service using the background process , although I am logged in as Admin User. When I call the service directly from the page, I have no issues. I have already checked the documentation and tried what was suggested in hte folllowing link : https://github.com/abpframework/abp/issues/2631 - Adding the [AllowAnonymous] attribute has not worked.

Any suggestions would be much appreciated. Please see stack trace below.

Thanks,

Jesse

  • ABP Framework version: v4.4.2
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
[17:54:57 WRN] Code:Volo.Authorization:010001
[17:54:58 WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.
Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.
   at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy)
   at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context)
   at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
   at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper)
   at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper)
   at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Cao.CatOs.Blazor.Admin.Multilingual.UpdateImportFileJob.ExecuteAsync(UpdateImportFileArgs args) in C:\CAT-OS\src\Cao.CatOs.Blazor\Admin\Multilingual\UpdateImportFileJob.cs:line 26
   at Volo.Abp.BackgroundJobs.BackgroundJobExecuter.ExecuteAsync(JobExecutionContext context)
[17:54:58 WRN] Code:Volo.Authorization:010001
[17:54:59 INF] HTTP GET / responded 200 in 30787.3336 ms
[17:54:59 WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.
Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.
   at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy)
   at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context)
   at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
   at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper)
   at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper)
   at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Cao.CatOs.Blazor.Admin.Multilingual.UpdateImportFileJob.ExecuteAsync(UpdateImportFileArgs args) in C:\CAT-OS\src\Cao.CatOs.Blazor\Admin\Multilingual\UpdateImportFileJob.cs:line 26
   at Volo.Abp.BackgroundJobs.BackgroundJobExecuter.ExecuteAsync(JobExecutionContext context)
[17:54:59 WRN] Code:Volo.Authorization:010001
[17:55:00 INF] HTTP POST /_blazor/negotiate?negotiateVersion=1 responded 200 in 11.8430 ms
[17:55:01 INF] HTTP GET /api/account/profile-picture-file/e3681333-e8f4-d343-bf26-39ff027eeb17 responded 200 in 829.9652 ms

Hi,

We are trying to implement a User tracking system inside our application. Basically we want to know who is logged on currently in the site. We have been investigating several ways to do this, and we were going to implement something like the following:

public interface IActiveUserRepository
{
    Task AddUserAysnc(UserCircuit user);
    Task<IList<UserCircuit>> GetUsers();
}

public class InMemoryActiveUserRepository : IActiveUserRepository
{
    private readonly Dictionary<string, UserCircuit> _activeUsers = new();

    public Task AddUserAysnc(UserCircuit user)
    {
        if (!_activeUsers.ContainsKey(user.UserId))
            _activeUsers.Add(user.UserId, user);

        return Task.CompletedTask;
    }

    public async Task<IList<UserCircuit>> GetUsers()
    {
        return await Task.Run(() => _activeUsers.Values.ToList());
    }
}

public class CustomAuthStateProvider : AuthenticationStateProvider
{
    private readonly IActiveUserRepository _users;

    public CustomAuthStateProvider(IActiveUserRepository users)
    {
        _users = users;
        AuthenticationStateChanged += OnAuthenticationStateChanged;
    }

    private async void OnAuthenticationStateChanged(Task<AuthenticationState> task)
    {
        var user = (await task).User;
        if (user.Identity.IsAuthenticated)
        {
            await _users.AddUserAysnc(new UserCircuit { UserId = user.Identity.Name });
        }
    }

    public override Task<AuthenticationState> GetAuthenticationStateAsync()
    {
        throw new System.NotImplementedException();
    }
}

//public class TrackingCircuitHandler : CircuitHandler
//{
//    private readonly HashSet<Circuit> circuits = new();

//    public override Task OnConnectionUpAsync(Circuit circuit,
//        CancellationToken cancellationToken)
//    {
//        circuits.Add(circuit);

//        return Task.CompletedTask;
//    }

//    public override Task OnConnectionDownAsync(Circuit circuit,
//        CancellationToken cancellationToken)
//    {
//        circuits.Remove(circuit);

//        return Task.CompletedTask;
//    }

//    public int ConnectedCircuits => circuits.Count;

//    public IList<Circuit> ActiveCircuits => circuits.ToList();
//}

public class UserCircuit
{
    public string CircuitId { get; set; }
    public string UserId { get; set; }
    public string Username { get; set; } = "Anonymous";
}

The question I have is , how do I access the AuthenticationStateProvider in ABP Framework? When I try to add the AuthenticationStateProvider via Dependecey Injection, I get an error since it already exists in the container.

Is there something out-of-box implemented by the ABP framework, that I can user to get all currently logged in users of the site? If not how is AuthenticationStateProvider implemented / exposed in the ABP framework?

Any help would be greatly appreciated.

Thanks,

Jesse

  • ABP Framework version: v4.4.2
  • UI type: Blazor Server
  • DB provider: EF Core

Hi,

When I try to execute the following Unit test (please see below) in Volo.Abp.LanguageManagement.Application.Tests (or most of the modules for that matter),

    [Fact]
    public async Task Get()
    {
        // Arrange

        // Act
        var localizedText = await _languageTextAppService.GetAsync("LanguageManagement", "en", "Yes", "en");

        //Assert.True(true);
        // Assert
        localizedText.ShouldNotBeNull();
    }

I get an error :

\JetBrains\Installations\ReSharperPlatformVs16_2db4cf06_000\TestRunner\netcoreapp2.0\ReSharperTestRunner.exe:3048 exited with code '-42': Not available

--- EXCEPTION #1/1 [LoggerException] Message = “ Process \JetBrains\Installations\ReSharperPlatformVs16_2db4cf06_000\TestRunner\netcoreapp2.0\ReSharperTestRunner.exe:3048 exited with code '-42': Not available ” ExceptionPath = Root ClassName = JetBrains.Util.LoggerException HResult = COR_E_APPLICATION=80131600

When I debugged the issue further I noticed the error occurs in the following method : (SeedTestData) in the class

namespace Volo.Abp.LanguageManagement
{
    [DependsOn(
        typeof(AbpAutofacModule),
        typeof(AbpTestBaseModule),
        typeof(AbpAuthorizationModule),
        typeof(LanguageManagementDomainModule)
        )]
    public class LanguageManagementTestBaseModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAlwaysAllowAuthorization();

            Configure<AbpLocalizationOptions>(options =>
            {
                options.Languages.Add(new LanguageInfo("en-US", "en", "English", "flag-icon flag-icon-gb"));
                options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe", "flag-icon flag-icon-tr"));
            });
        }

        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            SeedTestData(context);
        }

        private static void SeedTestData(ApplicationInitializationContext context)
        {
            AsyncHelper.RunSync(async () =>
            {
                using (var scope = context.ServiceProvider.CreateScope())
                {
                    await scope.ServiceProvider
                        .GetRequiredService<IDataSeeder>()
                        .SeedAsync();
                }
            });
        }
    }
}

I am unable to debug any further, but I do get to this point and can see the failure happens on SeedAsync(). I think that either the IDataSeeder is not being injected properly, or there is something I need to configure when executing Volo Unit Tests. It is using the in-memory database to seed the data, however I can not get the test to run. The test runner shuts down without any further exception message or stack trace. We have been able to duplicate this on three other developer machines.

Could you pleae provide me with a sample of how to execute the volo test cases in question? Is there something I was supposed to configure? This is specific to the Volo test cases that come out of box, when modules are installed locally using the abp suite tool.

Thanks in advance,

Jesse

  • ABP Framework version: latest
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

When creating a Unit test using BUnit I get the following issue when unit testing. The question I have is, are there a set of best practices to follow when using BUnit for unit testing? It appears any Blazor component inheriting from AbpComponentBase, will need to mock a lot of classes up front in order for the test to execute. Do you have some examples I could follow along for my unit testing? When I look at the documentation I see that examples will be coming soon. Please see the link : https://docs.abp.io/en/abp/latest/UI/Blazor/Testing

If you have any BUnit documentation, specifically for the ABP framework, that would be very helpful.

Thanks,

Jesse

  • ABP Framework version: Latest
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:

Volo.Abp.AbpException HResult=0x80131500 Message=authorizationService should implement Volo.Abp.Authorization.IAbpAuthorizationService Source=Volo.Abp.Authorization

Hi,

I am trying to add a menu item to the ApplicationMenuItem . In the MenuContributor.cs class, the following code returns the list of menu items: var administration = context.Menu.GetAdministration();

Is it possible to extend the ApplicationMenuItem, and add a new Menu item under Admin tab, from the module I created? Or do I have to download the volo module for Admin Menu items and add it there?

Any help would be appreciated.

Thanks,

Jesse

  • ABP Framework version: latest
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hi,

I have modified the volo framework - Volo.Abp.LanguageManagement , to add a new Interface - ICustomLanguageTextAppService. When I try to run the Blazor App I get the following error when - "There is no registered service of type 'Volo.Abp.LanguageManagement.ICustomLanguageTextAppService'"

The ICustomLanguageTextAppService inherits from the Volo.Abp.LanguageManagement interface ILanguageTextAppService. I have also modified the LanguageTextAppService with additional methods, to implement the new Interface ICustomLanguageTextAppService.

The question I have is, when I create a custom Interface inside the Volo.Abp.LanguageManagement module , how do I properly register the Interface / servcie in my Blazor App? I had no problems when I registered the ILanguageTextAppService in the same app.

Thanks,

Jesse

  • ABP Framework version: latest
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): No

Hi,

I would like to remove the SaaS Menu item from the main menu when logged in as Admin. Is there a way for me to turn it / make it invisible using the app.config or some other method?

Thank you,

Jesse

  • ABP Framework version: Latest
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hi,

Just FYI, I have already looked at the following three posts to see if my issue can be resolved:

https://support.abp.io/QA/Questions/1339/libssignalrbrowsersignalrjs'-for-the-bundle https://github.com/abpframework/abp/issues/5469 https://github.com/abpframework/abp/issues/5457

I get the following error when trying to run my application locally...please see stack trace:

AbpException: Could not find the bundle file '/libs/signalr/browser/signalr.js' for the bundle 'Lepton.Global'! Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService<TTagHelper, TService>.ProcessAsync(TagHelperContext context, TagHelperOutput output) Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, int i, int count) AspNetCore.Themes_Lepton_Layouts_Application_Default+<>c__DisplayClass28_0+<<ExecuteAsync>b__1>d.MoveNext() in Default.cshtml + <abp-script-bundle name="@LeptonThemeBundles.Scripts.Global"/> Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() AspNetCore.Themes_Lepton_Layouts_Application_Default.ExecuteAsync() in Default.cshtml + <body class="abp-application-layout @bodyClass @langDir"> Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|21_0(ResourceInvoker invoker, IActionResult result) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|27_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService) IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatcher|8_0(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task<Matcher> matcherTask) Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

When I run the gulp command in the root of the web directory I get the error:

'MODULE_NOT_FOUND'

On closer inspection I noticed the gulpfile.js contains the following code :

"use strict";

var gulp = require("gulp"), path = require('path'), copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js');

exports.default = function(){ return copyResources(path.resolve('./')); };

However the path specified (@abp/aspnetcore.mvc.ui/) does not exist since it is a Blazor app.

Any help you can provide with this issue would be greatly appreciated.

Thank you,

Jesse

  • ABP Framework version: Latest
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
Question

Hi,

While I was deploying our application to DEV via a pipeline in Azure Dev Ops, I noticed that the application would not load unless the ABP license was provided. I provided my license (dev site), and the application was able to load and work as expected. My question is, if after a year we do not renew the license, will our team still be able to use the framework , deploy it to environements etc.?

Thanks,

Jesse

  • **ABP Framework version:**latest
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
Showing 1 to 10 of 11 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11