0

I am working with ASP.NET core 2.0 console application

I am on entity framework core 2.0 and I am having error

'SchoolContext.OnConfiguring(DbContextOptionsBuilder)': no suitable method found to override

And

I can't find my project.json file

there's lot of solution to work out with project.json file

but i don't see it anywhere

ERROR MSG

I am stuck for 3 hours now

there's a link I have been following

http://www.entityframeworktutorial.net/efcore/entity-framework-core-console-application.aspx

7
  • Based on your screenshot, it seems that you have created a local DbContextOptionsBuilder class instead of using from Microsoft.EntityFrameworkCore namespace learn.microsoft.com/en-us/ef/core/api/…. Can you please confirm what DbContextOptionsBuilder file contains? If has the class then delete it. Jun 3, 2018 at 9:10
  • There is no method OnConfiguring to override
    – Vivek Nuna
    Jun 3, 2018 at 9:15
  • thanks , now i am facing, add-migration is not recognized problem Jun 3, 2018 at 9:32
  • and i can't find the .json file to work with the solutions over the internet Jun 3, 2018 at 9:33
  • If you don't ahave appSetttings.json to define the settings then add the one Jun 3, 2018 at 10:39

1 Answer 1

1

To override OnModelCreating and OnConfiguring methods, you need to have installed a NuGet package called Microsoft.EntityFrameworkCore.SqlServer.

You can do it when you right click on Solution -> NuGet Packages -> Install -> Microsoft.EntityFrameworkCore.SqlServer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.