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.

Unable to use Model.ToDebugString with EF Core 6 preview 4

See original GitHub issue

Include your code

var result =dbContext.Model.ToDebugString(MetadataDebugStringOptions.LongDefault);

And I am not able to find “DesignTimeModel” mentioned in the error message anywhere.

Include stack traces

System.InvalidOperationException: The requested configuration is not stored in the read-optimized model, please use 'DbContext.DesignTimeModel'.
   at Microsoft.EntityFrameworkCore.Metadata.SlimModel.Microsoft.EntityFrameworkCore.Metadata.IReadOnlyModel.GetChangeTrackingStrategy()
   at Microsoft.EntityFrameworkCore.Metadata.IReadOnlyModel.ToDebugString(MetadataDebugStringOptions options, Int32 indent)
   at Modelling.EfCoreModelBuilder.BuildResult(String outputPath, String startupOutputPath, Boolean generateDdl) in C:\Code\EFCorePowerTools\src\GUI\efpt30.core\EFCoreModelBuilder.cs:line 41
   at Modelling.Program.Main(String[] args) in C:\Code\EFCorePowerTools\src\GUI\efpt30.core\Program.cs:line 57

Include provider and version information

EF Core version: 6.0 preview 4 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 5.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
AndriySvyrydcommented, Jun 2, 2021

Fixed in a60795c94b6fc071f1247474793bcf1adf8eaff8

0reactions
ErikEJcommented, Jun 24, 2021

@AndriySvyryd Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Question] Where do column names get generated? #15581
Describe the problem. Can't configure TPH in EFCore 3.0.0-preview4 unless I am round-tripping my entire database using EF migrations. Steps to ...
Read more >
I get an error when I add migration using Entity Framework ...
c# - I get an error when I add migration using Entity Framework Core - Stack Overflow.
Read more >
Creating and Configuring a Model - EF Core
This model is built using a set of conventions - heuristics that look for common patterns. The model can then be customized using...
Read more >
Entity Framework Core: View the model as text
Note: I use the preview version of Entity Framework Core 2.0 (2.0.0-preview2-final). Things may change after the final version is released.
Read more >
106592: Unable to do Entity Framework Core Migration ...
Description: I was using the Nuget Package for MySql.EntityFrameworkCore package version 5.0.8+MySQL8.0.27.
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