We're working on upgrading our solution though we needed to migrate from IdentityServer to OpenIddict first. We followed this guide: https://docs.abp.io/en/commercial/latest/migration-guides/openIddict-step-by-step and https://docs.abp.io/en/commercial/latest/migration-guides/openIddict-mvc#web-project-tiered-solution and after a bit of fiddling with the application URLs we're getting the following:
ComponentNotRegisteredException: The requested service 'Volo.Abp.Account.Public.Web.Pages.Account.LogoutModel' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable<Parameter> parameters)
Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DefaultPageModelFactoryProvider+<>c__DisplayClass3_0.<CreateModelFactory>b__0(PageContext pageContext)
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.CreateInstance()
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
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()
Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
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)
StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in MiniProfilerMiddleware.cs
Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1+<<UseMiddlewareInterface>b__1>d.MoveNext()
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
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)
Expected: The user should be logged out Actual: This exception is shown when the user is directed to https://localhost:44357/Account/Logout
We're not using anything custom for auth, just the built-ins.
abp new Acme.MyMauiApp -t maui
Expected: The project should be created Actual:
[11:58:35 INF] ABP CLI (https://abp.io)
[11:58:35 INF] Version 6.0.0-rc.2 (Prerelease)
[11:58:35 INF] Creating your project...
[11:58:35 INF] Project name: Acme.MyMauiApp
[11:58:35 INF] Template: maui
[11:58:35 INF] Output folder: C:\Users\kfrancis\source\repos\testmaui2
Error occured while getting the latest version from https://abp.io/api/download/template/get-version/ : Remote server returns '404-Not Found'. Message: There is no template with name 'maui'!
[11:58:36 WRN] The remote service is currently unavailable, please specify the version.
[11:58:36 WRN]
[11:58:36 WRN] Find the following template in your cache directory:
[11:58:36 WRN] Template Name Version
[11:58:36 WRN]
[11:58:36 WRN] Use command: abp new Acme.BookStore -v version
Question, we've been working on migrating an app for a long time and we're getting there (takes a long to migrate from .NET 4.8 to this solution) but one issue we disagree on is where to store user-session-related information.
For example, in the app a user has a bit of a state that gets set as they move through the app. We don't want to include that state in the query string (stateless) as it would be too cumbersome. In the old app we stored it in session but we're not sure that's the correct way to go about it.
We just tried adding a claim to store that information but because the value(s) can change so frequently, we're not sure that's a good solution either.
Any ideas? We want to make sure whatever solution we use is compatible with scaling the system horizontally in the future as we're dealing with large user loads.
So, we're trying to setup testing for the devs so that when they create the db there are a ton of fake users covering a variety of our real world scenarios. Creating the users works fine but we're having a heck of a time setting up permissions so that when devs login to those accounts, they can use the system.
We'll create a tenant:
var tenant = await _tenantManager.CreateAsync(name: tenantName, editionId: editionId);
tenant = await _tenantRepository.InsertAsync(tenant, true);
Then we'll create the admin user:
IdentityUser user = new(_guidGenerator.Create(), userName ?? faker.Internet.UserName(), faker.Internet.Email(), tenantId: tenant.Id);
var createStatus = await _userManager.CreateAsync(user, CabMDConsts.AdminPasswordDefaultValue);
if (createStatus.Succeeded)
{
var roleResult = await _userManager.AddToRoleAsync(user, "admin");
if (roleResult.Succeeded) {
// just in case we need to specify?
var permissions = await _permissionManager.GetAllForRoleAsync(role);
foreach (var p in permissions.Where(p => p.IsGranted))
{
await _permissionManager.SetForUserAsync(user.Id, p.Name, true);
}
} else {
throw new InvalidOperationException($"Could not add user {user.UserName} to role {role}: {string.Join(", ", roleResult.Errors.Select(x => x.Description))}");
}
}
But when we login as these users, there's no menu and they can't do anything within in the app. Looking at the menu contributor, I'm seeing this:
I can see in the AbpUserRoles table that there is an entry seemingly associating that "admin" role to the user:
Any ideas? How can we seed fake users who have default roles and the permissions associated with those roles for testing?
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.
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:
Expected: The app should run normally. Actual: An exception occurs during module initialization.
I know there is a WPF template now, but is there any sample that could be shared that shows at least some structure/mvvm in use? Right now we're trying to port a Prism-based WPF app but Prism doesn't play nicely with Microsoft DI and we've been having a hell of a time getting something to work so it would be useful to get some advice from the experts ..
FreshMvvm? I was playing with Maui as well and FreshMvvm has some Maui integration so this would be nice for both.
Stack overflow.
Repeat 29649 times:
--------------------------------
at System.Text.Json.JsonSerializer.WriteUsingSerializer[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.Serialization.Metadata.JsonTypeInfo)
at System.Text.Json.JsonSerializer.Serialize(System.Text.Json.Utf8JsonWriter, System.Object, System.Type, System.Text.Json.JsonSerializerOptions)
at Volo.Abp.Json.SystemTextJson.JsonConverters.ObjectToInferredTypesConverter.Write(System.Text.Json.Utf8JsonWriter, System.Object, System.Text.Json.JsonSerializerOptions)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryWrite(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
--------------------------------
at System.Text.Json.JsonSerializer.WriteUsingSerializer[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.Serialization.Metadata.JsonTypeInfo)
at System.Text.Json.JsonSerializer.Serialize(System.Text.Json.Utf8JsonWriter, System.Object, System.Type, System.Text.Json.JsonSerializerOptions)
at Volo.Abp.Json.SystemTextJson.JsonConverters.ObjectToInferredTypesConverter.Write(System.Text.Json.Utf8JsonWriter, System.Object, System.Text.Json.JsonSerializerOptions)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryWrite(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetMemberAndWriteJson(System.Object, System.Text.Json.WriteStack ByRef, System.Text.Json.Utf8JsonWriter)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].OnTryWrite(System.Text.Json.Utf8JsonWriter, System.__Canon, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryWrite(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.Serialization.JsonConverter`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCoreAsObject(System.Text.Json.Utf8JsonWriter, System.Object, System.Text.Json.JsonSerializerOptions, System.Text.Json.WriteStack ByRef)
at System.Text.Json.JsonSerializer.WriteUsingSerializer[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Text.Json.Utf8JsonWriter, System.__Canon ByRef, System.Text.Json.Serialization.Metadata.JsonTypeInfo)
at System.Text.Json.JsonSerializer.WriteStringUsingSerializer[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef, System.Text.Json.Serialization.Metadata.JsonTypeInfo)
at System.Text.Json.JsonSerializer.Serialize[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon, System.Text.Json.JsonSerializerOptions)
at Volo.Abp.Json.SystemTextJson.AbpSystemTextJsonSerializerProvider.Serialize(System.Object, Boolean, Boolean)
at Volo.Abp.Json.AbpHybridJsonSerializer.Serialize(System.Object, Boolean, Boolean)
at Volo.Abp.Caching.Utf8JsonDistributedCacheSerializer.Serialize[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon)
at Volo.Abp.Caching.DistributedCache`2+<>c__DisplayClass51_0+<<SetAsync>g__SetRealCache|0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Volo.Abp.Caching.DistributedCache`2+<>c__DisplayClass51_0+<<SetAsync>g__SetRealCache|0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Volo.Abp.Caching, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]](<<SetAsync>g__SetRealCache|0>d<System.__Canon,System.__Canon> ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Volo.Abp.Caching.DistributedCache`2+<>c__DisplayClass51_0+<<SetAsync>g__SetRealCache|0>d[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Volo.Abp.Caching, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]](<<SetAsync>g__SetRealCache|0>d<System.__Canon,System.__Canon> ByRef)
at Volo.Abp.Caching.DistributedCache`2+<>c__DisplayClass51_0[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<SetAsync>g__SetRealCache|0()
at Volo.Abp.Caching.DistributedCache`2+<SetAsync>d__51[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Volo.Abp.Caching.DistributedCache`2+<SetAsync>d__51[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Volo.Abp.Caching, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]](<SetAsync>d__51<System.__Canon,System.__Canon> ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Volo.Abp.Caching.DistributedCache`2+<SetAsync>d__51[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Volo.Abp.Caching, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]](<SetAsync>d__51<System.__Canon,System.__Canon> ByRef)
at Volo.Abp.Caching.DistributedCache`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SetAsync(System.__Canon, System.__Canon, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions, System.Nullable`1<Boolean>, Boolean, System.Threading.CancellationToken)
at CabMD.Repositories.CabMDRepository`2+<SetCurrentVersionAsync>d__142[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[CabMD.Users.UserPreApproval_Id, CabMD.Domain.Shared, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionContextCallback(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext(System.Threading.Thread)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
at System.Threading.Tasks.Task.RunContinuations(System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SetExistingTaskResult(System.Threading.Tasks.Task`1<System.__Canon>, System.__Canon)
at Volo.Abp.Caching.DistributedCache`2+<GetAsync>d__45[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Volo.Abp.Caching.DistributedCache`2+<GetAsync>d__45[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Volo.Abp.Caching, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext(System.Threading.Thread)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
at System.Threading.Tasks.Task.RunContinuations(System.Object)
at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TrySetResult(System.__Canon)
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache+<GetAsync>d__13.MoveNext()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache+<GetAsync>d__13, Microsoft.Extensions.Caching.StackExchangeRedis, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext(System.Threading.Thread)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
at System.Threading.Tasks.Task.RunContinuations(System.Object)
at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TrySetResult(System.__Canon)
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache+<GetAndRefreshAsync>d__22.MoveNext()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache+<GetAndRefreshAsync>d__22, Microsoft.Extensions.Caching.StackExchangeRedis, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext(System.Threading.Thread)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
at System.Threading.Tasks.Task.RunContinuations(System.Object)
at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TrySetResult(System.__Canon)
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisExtensions+<HashMemberGetAsync>d__1.MoveNext()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.Extensions.Caching.StackExchangeRedis.RedisExtensions+<HashMemberGetAsync>d__1, Microsoft.Extensions.Caching.StackExchangeRedis, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext(System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
We're trying to make a simple example, but at the moment when we try and utilize IDistributedCache we're getting into some kind of serialization/deserialization loop causing a stack overflow. We're now trying to remove caching to see if the issue is, as we expect, related to caching only and we'll work on reproducing with a simple example like BookStore.
[09:52:10 ERR] Could not get token from the OpenId Connect server! ErrorType: Protocol. Error: invalid_grant. ErrorDescription: RequiresTwoFactor. HttpStatusCode: BadRequest
Volo.Abp.AbpException: Could not get token from the OpenId Connect server! ErrorType: Protocol. Error: invalid_grant. ErrorDescription: RequiresTwoFactor. HttpStatusCode: BadRequest
at Volo.Abp.IdentityModel.IdentityModelAuthenticationService.GetAccessTokenAsync(IdentityClientConfiguration configuration) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.IdentityModel\Volo\Abp\IdentityModel\IdentityModelAuthenticationService.cs:line 91
at Volo.Abp.Cli.Auth.AuthService.LoginAsync(String userName, String password, String organizationName) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Auth\AuthService.cs:line 90
at Volo.Abp.Cli.Commands.LoginCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\LoginCommand.cs:line 73
at Volo.Abp.Cli.CliService.RunInternalAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 158
at Volo.Abp.Cli.CliService.RunAsync(String[] args) in D:\ci\Jenkins\workspace\abp-framework-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 66
abp login (username) -p (password)
Expected: It should login Actual: The above error
In our custom repositories, we're not using EF but rather using ado since we're porting an older system that primarily used stored procedures. It works great, but now that we're setting the connection string using IConfiguration I need to find a way to either inject or substitute IConfiguration with a value that I can use for function testing and I just can't figure out how yet.
I know I can just simply use something in memory like this:
protected override void AfterAddApplication(IServiceCollection services)
{
var inMemorySettings = new Dictionary<string, string> {
{"ConnectionStrings:Default", "(connection string here to a local mssql instance in a known state)"},
};
IConfiguration configuration = new ConfigurationBuilder()
.AddInMemoryCollection(inMemorySettings)
.Build();
//var configuration = Substitute.For<IConfiguration>();
services.AddSingleton(configuration);
}
public BillingGroupRepositoryTests()
{
_billingGroupRepository = GetRequiredService<IBillingGroupRepository>();
}
But when I do, the test host just crashes. When I run tests for these repositories (like IBillingGroupRepository for example) without doing anything, I'll get the somewhat expected "The ConnectionString property has not been initialized."
I've tried AfterAddApplication, BeforeAddApplication, neither helped. The TestBase project doesn't seem to do anything like this since the majority of tests can work just fine in MySql, these just can't because they rely on Stored Procedures.
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
base.SetAbpApplicationCreationOptions(options);
var inMemorySettings = new Dictionary<string, string> {
{"ConnectionStrings:Default", "(connection string here to a local mssql instance in a known state)"},
};
IConfiguration configuration = new ConfigurationBuilder()
.AddInMemoryCollection(inMemorySettings)
.Build();
options.Services.ReplaceConfiguration(configuration);
}
Any ideas?
Volo.Abp.AbpException: No BLOB Storage provider was registered! At least one provider must be registered to be able to use the Blog Storing System. at Volo.Abp.BlobStoring.DefaultBlobProviderSelector.Get(String containerName) at Volo.Abp.BlobStoring.BlobContainerFactory.Create(String name) at Volo.Abp.BlobStoring.BlobContainerFactoryExtensions.Create[TContainer](IBlobContainerFactory blobContainerFactory) at Volo.Abp.BlobStoring.BlobContainer`1..ctor(IBlobContainerFactory blobContainerFactory) at lambda_method1856(Closure , Object[] ) at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate()
C:\Users\kfrancis\Projects\MysteryProject\aspnet-core>abp add-module Volo.Abp.BlobStoring.Database [16:16:40 INF] ABP CLI (https://abp.io) [16:16:41 INF] Version 4.4.0-rc.2 (Prerelease) [16:16:42 INF] Installing module 'Volo.Abp.BlobStoring.Database' to the solution 'MysteryProject' Build started... Build failed. Use dotnet build to see the errors. Reinforced.Typings.settings.xml : warning : Reinforced.Typings will not run because it is disabled in its configuration [C:\Users\kfrancis\Projects\MysteryProject\aspnet-core\src\MysteryProject.Domain.Shared\MysteryProject.Domain.Shared.csproj] [16:16:51 INF] Started database migrations... [16:16:51 INF] Migrating schema for host database... [16:16:52 INF] Executing host database seed... [16:16:55 INF] Successfully completed host database migrations. [16:16:55 INF] Executing default tenant database seed... [16:16:55 INF] Successfully completed default tenant database migrations. [16:16:55 INF] Successfully completed all database migrations. [16:16:55 INF] You can safely end this process...