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
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.
Grz, Kris.
Read my blog | Twitter Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
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.
Regards,
Quan Truong
Please, click 'Mark as answer' if you think my answer really help you. Thanks
ThatsIT
Participant
1026 Points
388 Posts
Creating controller problem
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
Thanks
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: Creating controller problem
Dec 16, 2012 11:46 AM|LINK
Hi,
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.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
ThatsIT
Participant
1026 Points
388 Posts
Re: Creating controller problem
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
Thanks
quantt
Member
215 Points
38 Posts
Re: Creating controller problem
Dec 16, 2012 11:47 AM|LINK
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.
Quan Truong
Please, click 'Mark as answer' if you think my answer really help you. Thanks
XIII
All-Star
182674 Points
23445 Posts
ASPInsiders
Moderator
MVP
Re: Creating controller problem
Dec 16, 2012 11:50 AM|LINK
Hi,
I meant, create a new solution with only an MVC application and class library with the EF parts in it and try that.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
ThatsIT
Participant
1026 Points
388 Posts
Re: Creating controller problem
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
RameshRajend...
Star
7983 Points
2099 Posts
Re: Creating controller problem
Dec 16, 2012 01:15 PM|LINK
Recreating the Edmx might be work. On a new Project I have not found any issue.
ThatsIT
Participant
1026 Points
388 Posts
Re: Creating controller problem
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.