You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The page documents how to create a project using a single DbContext with multiple providers using external migration assemblies, however this doesn't seem to work.
Providing the migrations assembly on creation of a migration:
The assembly hosting the context doesn't have references to the migration assemblies, and can't because it would create a circular dependency. The migrations assemblies require a reference to the context in order to function.
Am I missing something here?
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 7b011c7a-3534-78e3-b491-addd96fb5ba1
Version Independent ID: 371826c5-3ef2-4eef-32e9-d55c777cd9d3
A temporary workaround could be to copy the migration assembly dll's to the App.Data output folder after build, but that's not ideal at all. A better solution would be giving it a way to resolve those assemblies.
Looking at the Two project or Three project examples I'm not quite sure how it could work with no reference to the assemblies.
The Three Project example looked more promising, since it has a reference to the migrations assemblies as well as the DbContext. However, the DbContext cannot be found.
Note for triage: it would be really useful to have an actual sample solution for this so that I'm not left trying to stitch things together for multiple places.
The page documents how to create a project using a single DbContext with multiple providers using external migration assemblies, however this doesn't seem to work.
Providing the migrations assembly on creation of a migration:
Yields an error:
"Could not load assembly 'App.Data.Migrations.Sqlite'. Ensure it is referenced by the startup project 'App.Data'."
The assembly hosting the context doesn't have references to the migration assemblies, and can't because it would create a circular dependency. The migrations assemblies require a reference to the context in order to function.
Am I missing something here?
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: