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...
We're trying to use abp commerial on top of an existing database, and while we've been able to convert mostly everything to work - the users are one aspect that we haven't yet addressed. Is there a way for us to "plug in" to the existing asp.net identity tables (like AspNetUsers) OR alternatively, can we convert/insert them into the new tables (AbpUsers) and have it continue to work?
Question,
We're using the dynamic and non-dynamic forms, but we're wondering if it's possible to all the use of bootstrap horizontal forms to eliminate space after the labels:
Question for you,
We're well into the migration of our service from our old .NET 4.8 Webforms app (servicing 4000 users daily, oof) but we do have one complication that I'm wondering if you could help us with. The main task our app does is automate interation with a remote service. This remote service was such a pain that we developed a .net API wrapper around it and that alone has been a good source of revenue, because whoever designed that API must really hate their job. Anyways, the wrapper does a great job allowing our existing system to interact with the remote service sending and receiving thousands of files daily. The wrapper is WCF, handles creating self-signed certs to satisy the black box requirements, it's great. With our old system, we had a Windows Service that handled connecting to every account every n hours by forking a command line process that did only that and that mostly works but we want to split up sending of files from retreiving of files (our current way introduces great delay for submissions and it's not easily testable whatsoever).
Unfortunately, Microsoft in their wisdom, haven't kept WCF up with .NET 5 so we will need to find a way to allow an AsyncBackgroundJob
(to send files created by users) and a AsyncPeriodicBackgroundWorkerBase
to connect to that service to submit files and to check the remote service for files available for processing .. somehow.
We can implement the service in a number of ways, we've utilized: azure functions, separate processes, etc but I'm curious to see if you have any suggestions that would a) lend itself to be much more manageable in this solution and b) hopefully allow us to test at least some of it, not likely the actual remote sending but that's fine but at least the queuing and execution of these jobs/workers.
Thoughts?