Add-Migration InitialCreate throws an exception, but is successful

David Thielen
3,211
Reputation points
When I run Add-Migration InitialCreate
it successfully creates the EF classes. But it also throws the following exception:
PM> Add-Migration InitialCreate -context TrackingDbContext
Build started...
Build succeeded.
{"EventId":0,"LogLevel":"Information","Category":"LouisHowe.web.Program","Message":"Application starting up","State":{"Message":"Application starting up","{OriginalFormat}":"Application starting up"}}
{"EventId":0,"LogLevel":"Critical","Category":"LouisHowe.web.Program","Message":"Unhandled exception in Main()","Exception":"Microsoft.Extensions.Hosting.HostAbortedException: The host was aborted. at Microsoft.Extensions.Hosting.HostFactoryResolver.HostingListener.ThrowHostAborted() at Microsoft.Extensions.Hosting.HostFactoryResolver.HostingListener.OnNext(KeyValuePair\u00602 value) at System.Diagnostics.DiagnosticListener.Write(String name, Object value) at Microsoft.Extensions.Hosting.HostBuilder.ResolveHost(IServiceProvider serviceProvider, DiagnosticListener diagnosticListener) at Microsoft.Extensions.Hosting.HostApplicationBuilder.Build() at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build() at LouisHowe.web.Program.Main(String[] args) in C:\\Git\\LouisHowe\\LouisHowe.web\\Program.cs:line 220","State":{"Message":"Unhandled exception in Main()","{OriginalFormat}":"Unhandled exception in Main()"}}
To undo this action, use Remove-Migration.
PM>
What's going on here? And how do I avoid this exception?
thanks - dave
Developer technologies .NET Entity Framework Core
780 questions
Sign in to answer