question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix usage of assembly (fix db context class discovery)

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
morrisjdevcommented, Jul 24, 2020

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.

0reactions
hwanderscommented, Jul 23, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found