Fix usage of assembly (fix db context class discovery)
See original GitHub issueThe current sync manager uses Assembly.GetEntryAssembly()
to find the DbContext-Type used during a transfer of a change.
This makes in impossible to define the DbContext in a different assembly than the Entry Assembly.
It should be possible to use a different Assembly. A way to avoid this issue is to all registered DbContext-Types in a storage class.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Update Database: No DbContext was found in assembly
The way to fix it was to change the default project to DataAccess instead of one of the other ones. The issue i...
Read more >DbContext Class (Microsoft.EntityFrameworkCore)
Alternatively, if you would rather perform configuration externally instead of inline in your context, you can use DbContextOptionsBuilder<TContext> (or ...
Read more >Fix : No DbContext was found in assembly | ASP.NET CORE
In this video, i am going to show you, how to resolve that type of error like No DbContext was found in assembly....
Read more >EFDataSource - 'DbConfiguration' was set but this type was ...
An instance of 'DbConfiguration' was set but this type was not discovered in the same assembly as 'Entities 101' context. Either put the ......
Read more >Avoid Wrapping DbContext in Using (and other gotchas)
If you also use a repository or similar abstraction, be sure to set its lifetime to match your DbContext lifetime. The built-in ASP.NET...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes that is a good idea but after considering carefully I decided to not add the additional property.
The benefit is too small and it would make less sense when you’re rolling out an update because the server applications would not have to be synced on startup anyway.
Thank you for the clarification, I’m just getting acquainted to the code base.
It’s fine if it’s just an internal API, I thought it was an API directly if indirectly accessible by the actual clients (because I wasn’t looking deep enough).
My thoughts regarding updates in a cluster:
For a smooth upgrade path you might try to leave the old property in the request class for a while and cope with only one of them being set or create a new class for the new request altogether (and handle both separately). The next version can then remove the old property.
Of course that requires the users to perform a clean migration via one intermediate version with the behavior described above.