Search code examples
c#entity-frameworkdata-annotationsvs-web-site-projectvs-web-application-project

Converting to Web Application Project: EntityFramework/DataAnnotations type exists error


I'm working to convert an old Web Site project to a Web Application Project and I've run into this issue with no help from the compiler as to what I need to look at or possibly change.

Here's the full text of the error: "The type 'ColumnAttribute' exists in both 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'" error

Here's the lines in a cs file that are getting the error (in an entity class):

[Column(TypeName = "ntext")]
[Required]
public string r_roleDescription { get; set; }

The line with "Column(TypeName..." is highlighted with the error.

Any ideas?


Solution

  • Thanks for the responses. It turns out that the problem was the compiler getting lost because of too many errors. I copied over the files from the website project to the web application project one at a time, fixing errors as they appeared, and this error went away.

    Thanks,