Hello, Negative, the issue is at the moment of generating migration it includes in the up code a table that was already in previous migration up code. The issue is not at the moment of applying migration as far as I can see.
Hi, by any chance, can you share your application via email (to support@abp.io with the ticket number), so I can better assist you.
Regards.
Hi Engin Can, Yes, I found the foreign key error, there is no problem at the moment. We need to get used to the new test framework structure, we would love for you to explain in detail why such a change was made with a blog post or a live broadcast. Because we are trying very hard to write test codes. For example, finding the foreign key error can be very difficult. Finally, when the entity is created, the EfCore[Entity]DomainTests class is not created, I had to create this class myself. I would be happy if an issue record is opened for this. Thank you for your support.
Thanks. @maliming created an article to explain why we made such a change. You can read from https://abp.io/community/articles/the-new-unit-test-structure-in-abp-application-4vvvp2oy
Regards.
Hi Engin Can, I had to create EfCoreAbcDomainTests class for my Entity. Abp Studio should automatically generate this class for each entity. When I run it I get the following error. I get the same error for SampleDomainTest:
---- Microsoft.EntityFrameworkCore.DbUpdateException : An error occurred while saving the entity changes. See the inner exception for details. -------- Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'FOREIGN KEY constraint failed'.
Hi, it seems this is related to your own test case. If you share the complete steps, I can better assist you (also please share the test file). You can take the pre-defined sample tests for reference.
Hi, I made the following changes but I still get another error
protected
->public
public abstract class SampleDomainTests : AbcDomainTestBase where TStartupModule : IAbpModule
->
public class SampleDomainTests : AbcDomainTestBase<AbcDomainTestModule>
But this time I get this error:---- Autofac.Core.DependencyResolutionException : An exception was thrown while activating Volo.Abp.PermissionManagement.PermissionDataSeedContributor -> Volo.Abp.Authorization.Permissions.PermissionDefinitionManager -> Volo.Abp.PermissionManagement.DynamicPermissionDefinitionStore. -------- Autofac.Core.DependencyResolutionException : None of the constructors found on type 'Volo.Abp.PermissionManagement.DynamicPermissionDefinitionStore' can be invoked with the available services and parameters: Cannot resolve parameter 'Volo.Abp.PermissionManagement.IPermissionGroupDefinitionRecordRepository permissionGroupRepository' of constructor 'Void .ctor(Volo.Abp.PermissionManagement.IPermissionGroupDefinitionRecordRepository, Volo.Abp.PermissionManagement.IPermissionDefinitionRecordRepository, Volo.Abp.PermissionManagement.IPermissionDefinitionSerializer, Volo.Abp.PermissionManagement.IDynamicPermissionDefinitionStoreInMemoryCache, Microsoft.Extensions.Caching.Distributed.IDistributedCache, Microsoft.Extensions.Options.IOptions`1[Volo.Abp.Caching.AbpDistributedCacheOptions], Microsoft.Extensions.Options.IOptions`1[Volo.Abp.PermissionManagement.PermissionManagementOptions], Volo.Abp.DistributedLocking.IAbpDistributedLock)'.```
Hi, you don't need to make a change in the existing test projects (so, please revert your changes). With our new testing infrastructure, your tests will be shown in the Test Explorer (under the *.EntityFrameworkCore.Tests
projects - within relevant sub-folders) as follows:
We categorized tests with a folder-based approach, which gives you easier management.
This the error that im getting with services and similar to authserver as well.
SqlException has been thrown. The operation will be tried 2 times more. Exception: Login failed for user 'sa'.. Stack Trace: at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionPool.WaitForPendingOpen() --- End of stack trace from previous location -
I have tried connecting to sql server running in docker from ssms host machine localhost,1434 -
![]()
Hi, you said that you are using the default password coming from the ABP Studio templates, however, the default password is myPassw@rd
. It seems that you changed the default password (or using an already running sql-server container). Can you confirm?
If you changed the password, please don't forget to change it in the services' appsettings.json files:
Hi,
I'm not looking for this to be added as a feature request - I need to implement this functionality **now ** in my current project. Could you please provide guidance on how to implement role-based filtering for the user list with these specific requirements?For non-admin users:
- Filter out users with admin roles from the list
- Restrict view/management to non-admin users only
For admin users:
- Maintain full visibility of all users
- Keep all existing management capabilities
Thank you
Hi, sure. For that purpose, you should extend application services and interface implementations (https://abp.io/docs/latest/framework/architecture/modularity/extending/customizing-application-modules-overriding-services).
For example, you should extend the IdentityUserAppService
and override some of its methods, such as GetListAsync
method and check if the current-user has an admin
role or not and then call the relevant repository method (of course you should also create a new repository method for that purpose - maybe you can use custom Data-Filtering):
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IIdentityUserAppService))]
public class MyIdentityUserAppService : IIdentityUserAppService, ITransientDependency
{
//...
public override async Task<PagedResultDto<IdentityUserDto>> GetListAsync(GetIdentityUsersInput input)
{
if(!CurrentUser.IsInRole("admin"))
{
//call new repository method which filters to not show the 'admin' users
}
//keep the existing behaviour
return await base.GetListAsync(input);
}
}
Hi,
Can you provide me with a code example of the SignalR approach you are suggesting?
Hi, you can create a Hub, and then use the DisconnectAsync() method to control the disconnections (https://abp.io/docs/latest/framework/real-time/signalr):
1-) Create a Hub:
public class UserConnectionHub : AbpHub
{
public override async Task OnDisconnectedAsync(Exception exception)
{
await HandleUserLogout(Context.ConnectionId); //or your custom logic...
await base.OnDisconnectedAsync(exception);
}
}
2-) In your blazor side (connect):
var connection = new HubConnectionBuilder()
.WithUrl("/userConnectionHub")
.WithAutomaticReconnect()
.Build();
try
{
await connection.StartAsync();
Console.WriteLine("SignalR Connected.");
}
catch (Exception ex)
{
Console.WriteLine($"SignalR Connection Failed: {ex.Message}");
}
You can call the code above, in a constructor of your blazor pages (in the base class).
To be more specific it is the default password that comes with the microservice template architute using abp studio
Okay. I guess it gives an error as below right?
2/5/2025 8:39:39 AM [Error] Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "Question8744_Administration" requested by the login. The login failed.
Login failed for user 'sa'.
This means, your auth-server is up, but the administration service is either not up or hasn't created the database yet. So, please also run the all services and wait for 1-2 minutes to data seeders to be completed. Then, you will be able to open the auth-server and other services and applications:
I am editing the same template as you-- if I put hook point 11 and 12 before and after %%child-entities-create-edit-modals%% neither hook point will show up, I get blank lines instead. Same result if I put the custom-code-blocks in the <modal> or in the <ModalContent> section right above. I have tested with a few different positions. All that appears in the generated .razor files is whitespace.
^^ another trial that did not work
Hi, I'm able to reproduce your problem and will create an issue for this problem (our qa team could not reproduce it at the first time, because they first customized the template and then generated the pages). In the meantime, you can customize the template, then delete the *.razor
(your razor file) and regenerate again. This will add the other placeholders to your file and they will not be overridden. Alternatively, instead of deleting the file, you can manually add the placeholder to both templates in Suite UI and in your application.
Btw, your ticket has been refunded. Thanks for reporting this problem. Regards.
Hi
Just following up on this ticket. Its quite urgent and I am getting disappointed with the lack of response. This ticket is 9 days old now and I have only received 2 responses to date.
Thank you.
Hi, since this is not fully related to ABP, we need to test with your configurations and this takes some time. Sorry for the lack of communication. I will provide you with an answer asap.