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.

Using both EF 6 and EF core same time in net standard 2 and net full

See original GitHub issue

We are using ef core and ef 6 same time in net full projects and net standard 2 projects. But if I use Audit.EntityFramework, I can’t use audit in efcore with net full projects. If I use Audit.Entityframework.Core, then I can’t use ef6 in netstandard projects. If I use both, this time projects can’t build because of same namespace with same class of AuditDbContext. Is there any solution for this scenerio?

I’ve decided not to use audit.net in efcore with net full projects until I found a workaround. Until then I’ve decoreted base dbcontext implementation with compiler directives:

    public class MembershipContext :
#if NET47
        IdentityDbContext<User, Role, long, UserClaim, UserRole, UserLogin, RoleClaim, UserToken>
#elif NETSTANDARD2_0 || NETCOREAPP2_0
        Audit.EntityFramework.AuditIdentityDbContext<User, Role, long, UserClaim, UserRole, UserLogin, RoleClaim, UserToken>
#endif

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thepirat000commented, Jan 4, 2018

I think this is not a bug on the library. You should not mix EF versions. Also if I change the namespace of the Core package, I will be breaking backward compatibility. Also the code is on github, so nothing stops you to fork and create a temporary solution with your temporary workarounds, until you get rid of the dependency.

0reactions
bhupendrasinghnegicommented, Feb 19, 2019

@thepirat000 : Thanks a lot for your prompt reply, appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use EF Core 6.0 with an application that uses .Net ...
Net Standard 2.0 EF Core libraries to be multi targeted to both .Net Standard 2.0 (which will reference EF Core 3.1) and .Net...
Read more >
Supported .NET implementations - EF Core
EF Core is a .NET library. Both EF Core versions 6.0 and 7.0 target .NET version 6.0. In general, we target the latest...
Read more >
using EF Core and EF6 in the same application
In this article. It is possible to use EF Core and EF6 in the same application or library by installing both NuGet packages....
Read more >
General advice for legacy project migration to .NET ...
Continuing to use EF6 eliminates a whole bunch of potential issues with switching to EF Core. Nuget packages will depend on what they...
Read more >
EF Core 7 Finally Divorces Old .NET Framework
Microsoft guidance says: "EF Core has always supported many scenarios not covered by the legacy EF6 stack, as well as being generally much ......
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