Skip to content

Enhance EF Core migrations documentation with troubleshooting and multiple database guidance #4055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 22, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 15, 2025

This PR enhances the EF Core migrations documentation to address common issues developers face when working with Entity Framework migrations in .NET Aspire projects.

Key Enhancements

1. Package Manager Console Instructions

Added comprehensive guidance for using Visual Studio's Package Manager Console as an alternative to CLI commands:

  • Step-by-step instructions for Package Manager Console setup
  • Clear guidance on startup project vs default project configuration
  • Proper project selection requirements

2. Troubleshooting Section

Added detailed troubleshooting for the most common migration issues:

"No database provider has been configured" error:

  • Explanation of why this occurs in .NET Aspire projects
  • Step-by-step solution using temporary connection strings
  • Clear guidance on connection string naming to match app host configuration

Multiple databases scenarios:

  • Two approaches: separate migration services vs single service with multiple contexts
  • Code examples for both approaches
  • Best practices for managing multiple database schemas

Startup project configuration:

  • Clear distinction between CLI and Package Manager Console requirements
  • Guidance on which projects to select for different scenarios

3. Enhanced Clarity

  • Better explanation of where migrations should be created
  • Clarification that migration services run before other services start
  • Improved project structure guidance

Problem Solved

The original documentation existed but lacked practical troubleshooting guidance that developers needed when encountering common migration issues in .NET Aspire projects. This enhancement provides clear, actionable solutions to the specific problems mentioned in the GitHub issue.

Example of Enhanced Content

Before: Basic CLI instructions only
After: Both CLI and Package Manager Console instructions with troubleshooting

{
  "ConnectionStrings": {
    "ticketdb": "Server=(localdb)\\mssqllocaldb;Database=TicketDb;Trusted_Connection=true"
  }
}

The enhanced documentation now covers edge cases and provides solutions that work in real-world development scenarios.

Fixes #1664.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/database/ef-core-migrations.md docs/database/ef-core-migrations

@Copilot Copilot AI changed the title [WIP] Unclear or missing directions on EF migrations in Aspire Enhance EF Core migrations documentation with troubleshooting and multiple database guidance Jul 15, 2025
@Copilot Copilot AI requested a review from IEvangelist July 15, 2025 17:20
Copilot finished work on behalf of IEvangelist July 15, 2025 17:20
@Copilot Copilot AI requested a review from adegeo July 17, 2025 03:10
Copilot finished work on behalf of adegeo July 17, 2025 03:10
@IEvangelist IEvangelist marked this pull request as ready for review July 17, 2025 18:48
@IEvangelist
Copy link
Member

@alistairmatthews - might you have a read through of this, since you've done a lot recently with migrations, I'd be curious what you think of these changes.

Copy link
Collaborator

@alistairmatthews alistairmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few comments. I'm going to test the Multiple database scenario code next week. Ran out of time today.

Copy link
Contributor

@adegeo adegeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock

@Copilot Copilot AI requested a review from IEvangelist July 18, 2025 19:22
Copilot finished work on behalf of IEvangelist July 18, 2025 19:22
Copilot finished work on behalf of IEvangelist July 21, 2025 12:20
@Copilot Copilot AI requested a review from IEvangelist July 21, 2025 12:20
@IEvangelist IEvangelist merged commit 5e47a93 into main Jul 22, 2025
9 checks passed
@IEvangelist IEvangelist deleted the copilot/fix-1664 branch July 22, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unclear or missing directions on EF migrations in Aspire
4 participants