Activities of "EngincanV"

Which project can i implement YourCustomAttribute and also note that my Attribute will ensure that it is really image file not pdf and user just changed extension so i mean it is logic that's why i ask you which project will implement this attribute to put in mt dto which in contract project ?

Hi, yes you can create and define your attribute in the *.Application.Contracts project. You should basically create an attribute, inherit it from the ValidationAttribute base class of .NET, then override the IsValid method and apply your own logic.

Btw, in one of my old project, I had similar requirements and created an AllowedExtensionsAttribute as follows:

public class AllowedExtensionsAttribute : ValidationAttribute
    {
        private readonly string[] _extensions;
        public AllowedExtensionsAttribute(string[] extensions)
        {
            _extensions = extensions;
        }

        protected override ValidationResult IsValid(
            object value, ValidationContext validationContext)
        {
            if (value == null)
            {
                return ValidationResult.Success;
            }
            
            var file = value as IFormFile;
            var extension = Path.GetExtension(file.FileName);
            
            if (file.Length > 0 && file != null)
            {
                if (!_extensions.Contains(extension.ToLower()))
                {
                    return new ValidationResult(GetErrorMessage());
                }
            }

            return ValidationResult.Success;
        }

        public string GetErrorMessage()
        {
            return $"This extension is not allowed!";
        }
    }

and use the attribute:

[AllowedExtensions(new string[] { ".jpg", ".png", ".jpeg" })]
public IFormFile CoverImageFile { get; set; }

Since this is not related to ABP, you can refer to https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/reflection-and-attributes/ for further info.

Reopening the question, it's closed by the support bot again.

Answer

I have resolved the issue.The problem was with theDbTablePrefixin both Solution A and Module B.I had setpublic static string DbTablePrefix { get; set; } = "";which caused the table prefix to be empty.As a result,when generating the code and creating tables in Solution A,it attempted to create tables with the same names twice,leading to duplicate table names and failure in creating migrations.The solution was to set different values forDbTablePrefixin Solution A and Module B.

Good catch! Regards.

Answer

Hi, https://abp.io/qa/questions/9266/3a19c279-d6b1-c6b8-77ca-a427e652e7d1 did you try is this the root cause? I'll try it today but if you already tried, maybe it might be the reason, can you confirm?

As i expected, all tables from services not using specific connection string should be included in the Default database. Did I miss any configuration or is this the expected behavior?

Hi, normally in a layered architecture, it's like you expected. But in the microservice architecture, since we have services for each module, we already define connection strings for them, and they point to the related service. So, this is the reason, when you use the Default connection string there are some missing tables. (If you check the ConfigureDatabases method of each service, you can see that)

So, in your case, you should either define each service connection string per tenant or use the shared database option.

Answer

Hi, we fixed this problem a long time ago. We moved the related database migration logic to OnPreApplicationInitializationAsync method and didn't add any conditions like in the figure you shared:

In your code, you can remove the environment condition, it's wrong as you said.

Regards.

Hi, we have introduced a new feature called Idle Session Timeout, and it seems this is what you are looking for: https://abp.io/docs/latest/modules/account/idle-session-timeout

This feature was introduced in v9.1, so in your version, it can not be used. And I guess you can't update your version, so I can explain you what this feature does, and how it works, so maybe you can implement it your own project:

  1. We created an AccountIdleViewComponent and added it as a layout hook, so we can show a dialog to warn users, when the inactivity is detected, and they should either confirm the model to stay signed it or do nothing to be logged out automatically.
  2. We also created a js file that is added with the component, so we can check for the inactivity by using JS API, and then show the hidden component/model in the page, to warn the user.
  3. We also created a setting group, so admins can decide the inactivity period, but in your case, you can make it hardcoded and check for 30 seconds.

Regards.

Here in your example url is to application url. Did you ment auth-server URL? And is correct url in auth server Account/logout?

Actually, I just tried to indicate that if you have a post-logout URL, then it should be registered to the related table. But, you can forget the related sentence, which causes confusion.

And what makes auth server to forget __tenant.

I'm not an angular developer but your app's logout, using authService.logout(), should redirect the user to your auth server's logout endpoint. When they completely log out, then the __tenant cookie should be deleted. So, you can pass to the logout page a returnUrl to your login page, and then they can see your login page, and either select a tenant or directly login as a host user.

Answer

Hi, unfortunately, the image quality is not good enough to be seen in the related code. So, can you please share it as a code or send a better image?

Regards.

Answer

I have created the A.sln solution using ABP Studio (which includes AuthServer, HostApi, and Web). A.sln is my host application. Next, I need to create the B.sln solution, which is my Module. I need to install Module B into Solution A. I would like to use the NuGet method to install the module. How can I publish Module B to the NuGet dropdown list in ABP Studio? By default, the NuGet list does not include my module (please refer to the screenshot attached).

Hi, in the NuGet tab, we only list ABP's own modules, so it can be directly added to the related layers into your solution. So, if your ModuleB is published in NuGet, then you should add it yourself.

Showing 161 to 170 of 1343 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20