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 with ASP.NET MVC Project Setup Adding the Class Library Project

Jaime Jesus Guerra Torres
Jaime Jesus Guerra Torres
16,954 Points

To fix the app problem, i changed the ConnectionString from the Manager App.Config to the class library App.Config.

I switched the connection string code in the App.Config file in Console Project to the App.Config file in the Library project. This make EF to create a new Database [ComicBookShared.Data.Context]. Is this also a solution? or is not recommended.

Simon Coates
Simon Coates
28,694 Points

I did the same thing. I have an earlier version of the project on my computer and they seemed to share a database. I had wondered if changing the context key would mess up my other project. Plus i assumed controlling the database connection from outside the library project would be useful if multiple projects used the library. I don't know whether it's a good idea or not.

(comment might be too late to be of interest to you, but might be interesting for someone taking the course down the track)