Closed GetGol closed 6 months ago
Duplicate of #33176
Can you please try the workaround detailed in https://github.com/dotnet/efcore/issues/33176#issuecomment-1969668284
Can you please try the workaround detailed in #33176 (comment)
Added the mentioned switch into my DesignTimeService => it executed successfully.
Is this switch needed permanently or can I track a version or an issue to remove it from my code later?
@GetGol thanks for confirming. The fix has already been merged for 8.0.4, the tracking issue is #33176.
OutOfMemoryException when scaffolding from database
The same database and the same code worked before the upgrade from .net7 to .net8 (including EF Core).
The scaffolding process starts as usual and processes some tables etc.. But after a while the process seems to hang or remain in an endless loop. Then no further output is generated. I can then see in the task manager how the process continues to consume CPU resources, whereby the RAM consumption continues to increase until it is completely used up. A few seconds later, the process then terminates with the OutOfMemoryException (as in the output at the end including the stacktrace).
I have experimented with the parameter "-tables" and have found out that the process runs successfully if I omit one of the two tables "FIFErfBuch" or "FITaKontoplanKto". But I have not yet been able to gain any insight from this.
I have also tried to debug the process. I have attached myself with VisualStudio and paused the process during the hang phase and looked into the "callstack" or "parallel stack" window. It looked like it was hanging trying to determine the data type of a database column. Then I let it run for a few seconds and paused it again. According to the callstack, it was still/again stuck on the same column. But since neither a StackOverflowException appears and more and more RAM is consumed, I assume that it is not a thread blocking problem and also not a simple recursion loop.
I am executing the command in the PackageManagerConsole. Here is the "-verbose" output (truncated for readability and body-character limit in github issue):
Include provider and version information
EF Core version: 8.0.3 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 8.0 Operating system: Windows 11 Enterprise IDE: Visual Studio 2022 17.10.0 Preview 2.0
Untruncated output in attachment: full output.txt