I have a very annoying problem where every time I try to add a transition to my project, dotnet crashes and migrations are not created. This happens whether I dotnet ef migrations add or Add-Migration . The command starts to run, and if necessary, compilation occurs, and then it crashes using the StackOverflowException. Debugging provides the following information:
Unhandled exception at 0x00007FFF798C97DE (coreclr.dll) in dotnet.exe: 0xC00000FD: Qaru (parameters: 0x0000000000000001, 0x000000AC03A75FF8).
It also doesn't matter if my context has one Dbset whose objects have one int property or all objects with their complex properties and sets, etc. The only time I can create a hyphen and snapshot is if my context does not have DbSets.
I tried both the preliminary versions and the release of the .NET Core version, and also completely uninstalled the .NET Core SDK (since there were still old versions) and Visual Studio and reinstalled them.
I am using Visual Studio Enterprise 2015.3 for Windows 10 Pro, and my model class is below:
public class Player { [Key] public int PlayerID { get; set; } }
and my context is as follows:
public class LeagueContext : DbContext { public LeagueContext(DbContextOptions<LeagueContext> context) : base(context) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { } public virtual DbSet<Player> Players { get; set; } }
and my service configuration:
services.AddEntityFrameworkSqlServer().AddDbContext<LeagueContext>(config => { config.UseSqlServer(Configuration["ConnectionStrings:LeagueContext"]); });
My .json project, for:
{ "dependencies": { "Microsoft.NETCore.App": { "version": "1.0.0", "type": "platform" }, "Microsoft.AspNetCore.Diagnostics": "1.0.0", "Microsoft.AspNetCore.Mvc": "1.0.0", "Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview2-final", "type": "build" }, "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", "Microsoft.AspNetCore.StaticFiles": "1.0.0", "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", "Microsoft.Extensions.Configuration.Json": "1.0.0", "Microsoft.Extensions.Logging": "1.0.0", "Microsoft.Extensions.Logging.Console": "1.0.0", "Microsoft.Extensions.Logging.Debug": "1.0.0", "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0", "Microsoft.EntityFrameworkCore": "1.0.0", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0", "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", "Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final" }, "tools": { "BundlerMinifier.Core": "2.0.238", "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final", "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final" }, "frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "portable-net45+win8" ] } }, "buildOptions": { "emitEntryPoint": true, "preserveCompilationContext": true }, "runtimeOptions": { "configProperties": { "System.GC.Server": true } }, "publishOptions": { "include": [ "wwwroot", "Views", "Areas/**/Views", "appsettings.json", "web.config" ] }, "scripts": { "prepublish": [ "bower install", "dotnet bundle" ], "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] } }