Using both EF 6 and EF core same time in net standard 2 and net full
See original GitHub issueWe 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:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
@thepirat000 : Thanks a lot for your prompt reply, appreciated.