.NET MVC CORE

Unable to create an object of type 'ApplicationDbContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

//add builder.Services.AddDbContext(options => options.UseSqlServer( builder.Configuration.GetConnectionString(\"DefaultConnection\") )); var app = builder.Build(); just put database connection code before buil...

J
Joynal Abedin
6
//add
builder.Services.AddDbContext(options => options.UseSqlServer(
    builder.Configuration.GetConnectionString(\"DefaultConnection\")
    ));

var app = builder.Build();

just put database connection code before build the app then this problem will be solved.

J

Written by Joynal Abedin

Passionate about technology, code, and sharing knowledge.

0 Comments

Leave a Comment