So I've create a solution with multiple projects... one is for my website, the other for my data. I've added the reference and everything seems to be working just fine. Until now...
I recently created a model.edmx for a table and a stored procedure. When I trying and create a variable of that model, I get this error:
The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I'm assuming this is because I'm using multiple projects, I just don't know how to fix this!
Ah... just like having to add the reference to the other projects within the solution, I had to add a reference to the System.Data.Entity using that same right-click "Add Reference" dialog.
The project where you are trying to create a model object needs to have a reference to System.Data.Entity (as the error states).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With