I am struggling to update the Abp Suite. When I try to run commands in the cli it continues to ask me to login even after I have logged in successfully. I have tried reinstalling the cli but it is still not allowing me to run commands.
D:\Source\Git\NextecBase\NexBase\aspnet-core\nexapi\libs\NexModule.SappMtp>dotnet tool uninstall -g Volo.Abp.Cli Tool 'volo.abp.cli' (version '7.3.2') was successfully uninstalled.
D:\Source\Git\NextecBase\NexBase\aspnet-core\nexapi\libs\NexModule.SappMtp>dotnet tool install -g Volo.Abp.Cli You can invoke the tool using the following command: abp Tool 'volo.abp.cli' (version '7.3.2') was successfully installed.
D:\Source\Git\NextecBase\NexBase\aspnet-core\nexapi\libs\NexModule.SappMtp>abp login bhyatz ABP CLI 7.3.2 Password: Successfully logged in as 'bhyatz'
D:\Source\Git\NextecBase\NexBase\aspnet-core\nexapi\libs\NexModule.SappMtp> abp suite update ABP CLI 7.3.2 Please login with your account.
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:
Hi
My devart oracle connection is not working after updating to 4.2.1. We were actually migrating from version 3.0.4 so the error could have been introduced earlier. We are getting "The specified transaction is not associated with the current connection." error in the background.
I am able to reproduce the problem using the steps below with a new solution.
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
new DbContextOptionsBuilder<NexBaseMigrationsDbContext>() .UseOracle(configuration.GetConnectionString("Default"));
Add Migrations src\NexBase.EntityFrameworkCore.DbMigrations>dotnet ef -s ..\NexBase.DbMigrator migrations add Initial Build started... Build succeeded. Done. To undo this action, use 'ef migrations remove'
Run migrations src\NexBase.EntityFrameworkCore.DbMigrations>dotnet ef -s ..\NexBase.DbMigrator database update Build started... Build succeeded. Applying migration '20210224162217_Initial'.
Seed Data. Run dbMigrator project
[18:38:19 INF] Started database migrations...
[18:38:19 INF] Migrating schema for host database...
[18:38:21 INF] Executing host database seed...
Unhandled exception. System.InvalidOperationException: The specified transaction is not associated with the current connection. Only transactions associated with the current connection may be used.
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction..ctor(IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger1 logger, Boolean transactionOwned) at Microsoft.EntityFrameworkCore.Storage.RelationalTransactionFactory.Create(IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger
1 logger, Boolean transactionOwned)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.CreateRelationalTransaction(DbTransaction transaction, Guid transactionId, Boolean transactionOwned)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.UseTransactionAsync(DbTransaction transaction, Guid transactionId, CancellationToken cancellationToken)
at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextWithTransactionAsync(IUnitOfWork unitOfWork) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider
1.CreateDbContextAsync(IUnitOfWork unitOfWork)
at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider
1.GetDbContextAsync()
at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetDbSetAsync() at Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityUserRepository.FindByNormalizedUserNameAsync(String normalizedUserName, Boolean includeDetails, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Volo.Abp.Identity.IdentityDataSeeder.SeedAsync(String adminEmail, String adminPassword, Nullable1 tenantId) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context)
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.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at NexBase.Data.NexBaseDbMigrationService.SeedDataAsync(Tenant tenant) in C:\tmp\abp\Nexbase\aspnet-core\src\NexBase.Domain\Data\NexBaseDbMigrationService.cs:line 107
at NexBase.Data.NexBaseDbMigrationService.MigrateAsync() in C:\tmp\abp\Nexbase\aspnet-core\src\NexBase.Domain\Data\NexBaseDbMigrationService.cs:line 57
at NexBase.DbMigrator.DbMigratorHostedService.StartAsync(CancellationToken cancellationToken) in C:\tmp\abp\Nexbase\aspnet-core\src\NexBase.DbMigrator\DbMigratorHostedService.cs:line 30
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at NexBase.DbMigrator.Program.Main(String[] args) in C:\tmp\abp\Nexbase\aspnet-core\src\NexBase.DbMigrator\Program.cs:line 29
at NexBase.DbMigrator.Program.<Main>(String[] args)
[18:47:30 ERR] The specified transaction is not associated with the current connection. Only transactions associated with the current connection may be used.
System.InvalidOperationException: The specified transaction is not associated with the current connection. Only transactions associated with the current connection may be used.
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction..ctor(IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger1 logger, Boolean transactionOwned) at Microsoft.EntityFrameworkCore.Storage.RelationalTransactionFactory.Create(IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger
1 logger, Boolean transactionOwned)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.CreateRelationalTransaction(DbTransaction transaction, Guid transactionId, Boolean transactionOwned)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.UseTransactionAsync(DbTransaction transaction, Guid transactionId, CancellationToken cancellationToken)
at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextWithTransactionAsync(IUnitOfWork unitOfWork) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider
1.CreateDbContextAsync(IUnitOfWork unitOfWork)
at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider
1.GetDbContextAsync()
at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetDbSetAsync() at Volo.Abp.FeatureManagement.EntityFrameworkCore.EfCoreFeatureValueRepository.GetListAsync(String providerName, String providerKey) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at Volo.Abp.FeatureManagement.FeatureManagementStore.SetCacheItemsAsync(String providerName, String providerKey, String currentName, FeatureValueCacheItem currentCacheItem)
at Volo.Abp.FeatureManagement.FeatureManagementStore.GetCacheItemAsync(String name, String providerName, String providerKey)
at Volo.Abp.FeatureManagement.FeatureManagementStore.GetOrNullAsync(String name, String providerName, String providerKey)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Features.TenantFeatureValueProvider.GetOrNullAsync(FeatureDefinition feature) at Volo.Abp.Features.FeatureChecker.GetOrNullValueFromProvidersAsync(IEnumerable
1 providers, FeatureDefinition feature)
at Volo.Abp.Features.FeatureChecker.GetOrNullAsync(String name)
at Volo.Abp.Features.FeatureCheckerBase.IsEnabledAsync(String name)
at Volo.Abp.Account.Public.Web.Ldap.LdapExternalLoginProvider.TryAuthenticateAsync(String userName, String plainPassword)
at Volo.Abp.Identity.AspNetCore.AbpSignInManager.PasswordSignInAsync(String userName, String password, Boolean isPersistent, Boolean lockoutOnFailure)
at Volo.Abp.Account.Public.Web.Areas.Account.Controllers.AccountController.Login(UserLoginInfo login)
at lambda_method1837(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
We a developing out solution as seperate modules. I would like to know what is the best method to use to communicate between modules.
Reading up it seems that the best method is to communicate using application services, however this may cause security related issues between modules.
e..g Module B runs a backround service that has to get a list of new events from module A.
Module B does not have a user associated to it. Module A's method to get the list of tasks needs to check if the user making a request to the webapi service has access to the tasks.
IS there a way to check the request is coming from another microservice and not from a user to allow the user to access the items? Will the ABP permission on the application service block the call if the method is called from another microservice?
What is the best way to implement this type of communication between modules without compromising on security
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
I can't see the custom claim in the current user or pricipal
I have added a custom claim type "testClaimType" using the frontend
I have added the a claim value for this claim to the Admin user
During Login The AbpUserClaimsPrincipalFactory loads the custom claims correctly. As you can see there is claim of testClaimType with value 12.
However the claim type does not show in the current user claims or the ClaimsPrincipal .
How do you get the claims for the custom claim types for the current user?
Is it possible to add the custom claim types to the current users claims?
I have extended abpuserroles to include Active and Inactive dates so a user will only have a role between these dates.
However I found several places where the user roles are used in the code. However I can't find the place where the roles are assigned to the user when he logs in.
I need to change the login so that only roles that are active are assigned to a user when he logs in. Where do I modify this logic?
What is the best way to implement impersonation in the current framework?
Hi
I would like to add valid from and valid to dates for user roles.
I need the user to only have a role between these dates.
How do I implemet this functionality so that the roles are only returned if the current dates are between these dates.
I have added custom properties to Appuser /* Add your own properties here. Example: * * public virtual string MyProperty { get; set; } */ public virtual bool Active { get; set; } = false; public virtual DateTime ValidFromDate { get; set; } public virtual DateTime ValidToInclDate { get; set; } public virtual string DeactivationReason { get; set; }
What is the best way to extend the login validation to check if the user is active and if the current date is between the Valid From and Valid To dates when the user logs in. How do I customize the adduser to include the added fields when creating the user?
I have added new setting definitions to my module public override void Define(ISettingDefinitionContext context) { /* Define module settings here. * Use names from AumSettings class. */ context.Add( new SettingDefinition(name : AumSettings.EmailRequired, defaultValue : "true", displayName : new LocalizableString( typeof(AumResource),"Setting:EmailRequired" ), description : new LocalizableString(typeof(AumResource), "Setting:EmailRequiredDescription"), isVisibleToClients : true ), new SettingDefinition(name: AumSettings.PhoneRequired, defaultValue: "false", displayName: new LocalizableString(typeof(AumResource), "Setting:PhoneRequired"), description: new LocalizableString(typeof(AumResource), "Setting:PhoneRequiredDescription"), isVisibleToClients: true ) );
}
However these settings do not appear on the settings managment UI. What do I have to do to get these settings to be configurable on the settings page. the only settings visible are for the built in modules Identity management Lepton theme settings and Account
We wish to support multiple databases, both oracle using the devart driver and SQL Server. The current depends on EntityFrameworkCoreModule depends on AbpEntityFrameworkCoreSqlServerModule. We wish to be able to switch between oracle and sql server using a configuration setting in the appsettings.json. 1. If we remove the AbpEntityFrameworkCoreSqlServerModule module and change the Configure<AbpDbContextOptions>(options => { options.UseSqlServer(); } to options.UseOracle(); will this just work. 2. Can we change this setting to if(dbType == "Oracle") { options.UseSqlServer(); } else { options.UseOracle(); } 3. The current geenrated EntityFrameworkCoreModule depends on AbpEntityFrameworkCoreSqlServerModule, If we do this and take out [DependsOn(typeof(AbpEntityFrameworkCoreSqlServerModule)] will sql server still work? if we leave it will oracle work? 4. I tried changing the table names to snake case, this worked for the migrations but at runtime the modules don't use the conversion. Is it possible to make the modules work with the snake case naming convension.