Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Entity Framework Basics CRUD Operations Creating Entities

Mark Ramos
Mark Ramos
19,209 Points

Errors when loading this project

I used the link in the previous video to download this solution. I loaded the solution in Visual Studio and updated Entity Framework to its latest version (6.2.0). I've got a couple build errors right off the bat. Does looking at these shed any light on what I've done wrong or am missing?

Error CS1061 'object' does not contain a definition for 'SetInitializer' and no accessible extension method 'SetInitializer' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) ComicBookLibraryManager C:\Users\Mark\source\repos\aspnet-comic-book-gallery-model\src\ComicBookLibraryManager\ComicBookLibraryManager\Data\Context.cs

Error CS1061 'object' does not contain a definition for 'Log' and no accessible extension method 'Log' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) ComicBookLibraryManager C:\Users\Mark\source\repos\aspnet-comic-book-gallery-model\src\ComicBookLibraryManager\ComicBookLibraryManager\Data\Repository.cs

1 Answer

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

Try to update from the package manager console to the most recent stable version. It will be fixed

Mark Ramos
Mark Ramos
19,209 Points

This didn't fix it, but for anyone else with issues, I got around it by deleting the project and re-uploading it. I updated from NuGet GUI again to the latest version, and it worked fine. Go figure.

Thank you, Mark Ramos. I also downloaded and unzipped the code but when i opened it in VS, got similar errors. So I opened the NuGet Manager to update my solution. When I updated EntityFramework, the error messages went away.