Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 16, 2012 01:20 PM by ThatsIT
Dec 16, 2012 11:41 AM|LINK
I have a dll. project with databse first entity model using EF5, I include this as a reference in a MVC4 web site, I have been doing this on all my projhects with no problem. but now i get an error
'Project.Models.dbEntities' is not part of the specified 'Project.Models.dbEntities' class, and the 'Project.Models.dbEntities' class could not be modified to add a 'DbSet<Project.Models.dbEntities>' property to it. (For example, the 'Project.Models.dbEntities'
class might be in a compiled assembly.)
I found one reference to this problem where is was said to delete the edmx file and recreate it, but This does not work for me.
I dont want to have the entity model in the website itself, but that seems to be the only way around.
Can any one shed any light on this, is thuis a bug or by design. It would seem to me that this is since the
Visual Studio 2012 Update 1
Dec 16, 2012 11:46 AM|LINK
I have been doing this on all my projhects with no problem. but now i get an error
Seems then it's rather an isolated case no? If you create a new MVC 4 site and make a reference to another class library project in which the EF lives do you also have it or not?
I'm making use of IoC (Unity) in my MVC 3 application and have EF code first 4.3.1 (recently updated to 5) in it without any problems.
I suggest you clean your solution via Build | Clean solution, then rebuild the entire solution and then try again.
Dec 16, 2012 11:47 AM|LINK
I have done both, tried to add to a new project and cleaned project and rebuilt but to no avail
Make sure Project.Models.dbEntities , it was build . You can rebuild project and try again. Make sure Project.Models.dbEntities build successfully and reference EntityFramework into project.
Dec 16, 2012 11:50 AM|LINK
tried to add to a new project and cleaned project and rebuilt but to no avail
I meant, create a new solution with only an MVC application and class library with the EF parts in it and try that.
Dec 16, 2012 12:03 PM|LINK
I just made a new project with a new class lib containing the entity model, same result. i suspect this is since the VS 2012 update 1
Dec 16, 2012 01:15 PM|LINK
Recreating the Edmx might be work. On a new Project I have not found any issue.
Dec 16, 2012 01:20 PM|LINK
I solved the problem by rebooting my machine (should of done so before posting), what was wrong i dont know but all is working again.
Hope it helps someone else one day.