Open Closed

Using second database for AbpAuditLogging module #1657


User avatar
0
fishlong created

Hi guys,

I followed the instructions and put the auditlogging module in the second database, but got "More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands." in package console when Add-Migration "Initial".

The same error occurred when I put a custom business module in a separate DB .

Can someone tell me the correct operation?

Check the docs before asking a question: https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Migrations 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.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.3.3
  • UI type:MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    You can specific the --context parameter.

    dotnet ef migrations add Your_Migration_Name --context MyProjectNameDbContext
    
    dotnet ef migrations add Your_Migration_Name --context MyProjectNameTenantDbContext --output-dir TenantMigrations
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    fishlong created

    thanks a lot!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 17, 2026, 08:41
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.