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.

DbContextSplitting stopped working in version 2.5.1378 (April 20, 2023)

See original GitHub issue

First, thank you for a fantastic tool!

We have been using EF Core Power Tools in our Database First project for some time now, and up to and including version 2.5.1338 it was working as expected, but after installing version 2.5.1378 (and it continued to be broken in 2.5.1429), the OnModelCreating()-method in our DbContext-class stopped having lines of

modelBuilder.ApplyConfiguration(new Configurations.MyEntityConfiguration());

and instead had all the code from the configurations instead.

None of the settings in efpt.config.json have been changed, and it still contains

"UseDbContextSplitting": true,

Our project uses EF Core 6 in a .NET 6 ASP NET Core project, and our database is SQL Server. We use Visual Studio 2022.

We are not using Handlebars, T4 or dacpac.

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:25 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, May 10, 2023

Hooray - I am finally able to repro with .1429 extension also for EF Core 6.

1reaction
NorwegianKiwicommented, May 9, 2023

I was trying to make a minimal repro, and I discovered that the bug only occurred when I included one specific table. In particular, if I add the following two tables (Element and Relation), it breaks. But if I only include one of them (either one) it is ok:

CREATE DATABASE ReproSplitContextDB;
USE ReproSplitContextDB

CREATE TABLE Element (
    id VARCHAR(50) NOT NULL,
    title VARCHAR(50) NOT NULL,
    CONSTRAINT PK_Element PRIMARY KEY (id)
)

CREATE TABLE Relation (
    parentId VARCHAR(50) NOT NULL,
    childId VARCHAR(50) NOT NULL,
    CONSTRAINT PK_Relation PRIMARY KEY (parentId, childId),
    CONSTRAINT FK_Relation_Element_child FOREIGN KEY (childId) REFERENCES Element (id),
    CONSTRAINT FK_Relation_Element_parent FOREIGN KEY (parentId) REFERENCES Element (id)
)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Release notes · ErikEJ/EFCorePowerTools Wiki
2.5.1378 (April 20, 2023). New features. Implement Compare with .NET 7 #1746. Improvements. Collection setters for EF Core 7 added back (via ...
Read more >
EFCorePowerTools
DbContextSplitting stopped working in version 2.5.1378 (April 20, 2023) $ 0 ... the OnModelCreating() -method in our DbContext-class stopped having lines of
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