efcore: StackOverflowException on DbContext after Upgrading from 2.2.1 to 2.2.2

Exception

Process is terminating due to StackOverflowException.
The program '[2823] Project.Api.dll' has exited with code 0 (0x0).

I also get a Window on my MAC with the message:

dotnet quit unexpectedly
Click Reopen to open the application again. This report will be sent to Apple automatically. 

Steps to reproduce

I have the following:

IQueryable<Country> countries = _context.Countries.AsNoTracking();

I get the StackOverflowException on this code line or any code line that uses DbContext.

I also get the StackOverflowException only by inspecting the DbContext instance.

This code was working with ASP.NET Core 2.2.1 … Got the exception after upgrading to 2.2.2.

The DbContext configuration is the same:

services.AddDbContext<Context>(x => x.UseSqlServer(connectionString, y => { 
  y.MigrationsHistoryTable("__Migrations"); 
  y.UseNetTopologySuite();
}));      

Further technical details.

EF Core version: 2.2.2
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: macOs Mojave 10.14.3
IDE: Visual Studio Code 1.31.1

The dotnet info command output is:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.104
 Commit:    73f036d4ac

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx.10.14-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.2.104/

Host (useful for support):
  Version: 2.2.2
  Commit:  a4fd7b2c84

.NET Core SDKs installed:
  2.2.104 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 32 (22 by maintainers)

Most upvoted comments

@smitpatel did you try on a Mac?

I tried this on that project and also on another one and I got the StackOverflow exception in both cases.

I am using a Docker container for the SQL Database in Mac.

Not sure if that could affect but I think not …