DotNetMastery / Rocky

85 stars 80 forks source link

add-migration in ASP.NET Core MVC - Up and Running Part 2 (.NET Core 5) #3

Open ostwolf opened 3 years ago

ostwolf commented 3 years ago

Hi I'm getting this error when trying to add migration after upgrading the project in Package Manager Console...

'Microsoft.AspNetCore.Authentication.AuthenticationBuilder Microsoft.Extensions.DependencyInjection.OAuthExtensions.AddOAuth(Microsoft.AspNetCore.Authentication.AuthenticationBuilder, System.String, System.String, System.Action`2<System.__Canon,!!2>)'. Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

bhrugen commented 3 years ago

can you make sure all projects are in .NET 5?

ostwolf commented 3 years ago

Hi! Yes, all seems is the correct version. I had to put comment on this fragment in Startup.cs. After I commented it everything works fine. Can you explain why please? : services.AddAuthentication().AddFacebook(Options => { Options.AppId = "979166549209276"; Options.AppSecret = "0136648c5c6de648ac4d61b2d6534281"; });

Regards Alex