none
System.ComponentModel.DataAnnotation.Schema not exists VS11 RRS feed

  • Question

  • Greetings,

    I am using Visual Studio 11  and i am trying to use EF5 beta-2 to test the enum option

    Scenario:

    1- i created a class library project with target framework 4.5

    2- i opened the Package Manager Console (PMC)

    3- i typed " install-package entityframework -pre"

    4- PMC installled for me the EntityFramework and also System.ComponentModel.DataAnnotation

    5- i tried to make this example below

    [Table("Employees")]
    public class TEmployee{
    [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int ID{get; set;}
    [StringLength(100),Required]
    public string Name{get;set;}
    
    }

    6- compiler gave me error that i am missing a reference
    7- i read about the entity framework that they moved the TableAttribute to System.ComponentModel.DataAnnotation.Schema namespace

    8-  i tried to add using at top for : System.Component.DataAnnotation.Schema but it wasn't there

    any idea guys?

    thanks in advance


    Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.(Mosher’s Law of Software Engineering)

    Saturday, March 31, 2012 7:31 AM

Answers

  • Greetings,

    the problem was in the Visual Studio program i have, it was Visual Studio 11 Preview, the problem solved when i upgrade it to Visual Studio 11 Beta

    thanks for everyone tried to help

    regards 


    Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.(Mosher’s Law of Software Engineering)

    • Marked as answer by Hadi2008 Wednesday, April 4, 2012 6:45 AM
    Wednesday, April 4, 2012 6:44 AM

All replies

  • Greetings again,

    i opened the entityframework.dll version 5.0.0 beta-2 in reflector and it doesn't contain System.Component.DataAnnotation.Schema!!

    while the entityframework.dll version 4.4 ( VS2010) in reflector it contains it

    how to solve this issue?

    regards


    Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.(Mosher’s Law of Software Engineering)

    Saturday, March 31, 2012 8:45 AM
  • Hi Hadi2008,

    Welcome to MSDN Forum.

    I can repro the issue, I will consult the product team and come back as soon as possible.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 3, 2012 2:51 AM
    Moderator
  • Greetings,

    the problem was in the Visual Studio program i have, it was Visual Studio 11 Preview, the problem solved when i upgrade it to Visual Studio 11 Beta

    thanks for everyone tried to help

    regards 


    Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.(Mosher’s Law of Software Engineering)

    • Marked as answer by Hadi2008 Wednesday, April 4, 2012 6:45 AM
    Wednesday, April 4, 2012 6:44 AM
  • Hi Hadi2008,

    I'm glad to hear that you have solved the issue, and thanks for sharing the experience.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 4, 2012 6:50 AM
    Moderator