I am working through a tutorial using C# and MVC for the first time. I got to the part where it is developing the simplemembership login and when I create the method in the "accountModel.cs" class that generates the table I get the following error:
Error 1 The type 'System.ComponentModel.DataAnnotations.Schema.TableAttribute' exists in both 'c:\Users\*****\Documents\Visual Studio 2012\Projects\MyProductStore\packages\EntityFramework.5.0.0-rc\lib\net40\EntityFramework.dll' and 'c:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll' C:\Users\*****\documents\visual studio 2012\Projects\MyProductStore\MyProductStore\Models\AccountModels.cs 23 6 MyProductStore
ICStech
Member
18 Points
24 Posts
MVC 4 error Type in 2 dll's
Oct 07, 2012 07:30 PM|LINK
I am working through a tutorial using C# and MVC for the first time. I got to the part where it is developing the simplemembership login and when I create the method in the "accountModel.cs" class that generates the table I get the following error:
Error 1 The type 'System.ComponentModel.DataAnnotations.Schema.TableAttribute' exists in both 'c:\Users\*****\Documents\Visual Studio 2012\Projects\MyProductStore\packages\EntityFramework.5.0.0-rc\lib\net40\EntityFramework.dll' and 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll' C:\Users\*****\documents\visual studio 2012\Projects\MyProductStore\MyProductStore\Models\AccountModels.cs 23 6 MyProductStore
Ken Tucker
All-Star
16797 Points
2608 Posts
MVP
Re: MVC 4 error Type in 2 dll's
Oct 07, 2012 08:38 PM|LINK
.Net 4.5 has been released. Delete the reference to EntityFramework.5.0.0-rc and make sure the dll is not bin folder of the web site.
Space Coast .Net User Group
ICStech
Member
18 Points
24 Posts
Re: MVC 4 error Type in 2 dll's
Oct 07, 2012 09:37 PM|LINK
Thanks for replying, I have done that but now It is throwing errors on the following
public class UsersContext : DbContext
{
public UsersContext()
: base("DefaultConnection")
{
}
public DbSet<UserProfile> UserProfiles { get; set; }
}
with the error of a missing dll or reference for the DbSet and the DbContext which of course is all over the project and not just in the one class.
Thanks