No connection string named could be found in the application config file

前端 未结 9 1198
时光取名叫无心
时光取名叫无心 2020-12-29 06:54

I\'m using EF and generated .EDMX from it but then I only wanted it to be used for automated generation of Class Files.

I then used the Class Files to create a Enti

9条回答
  •  旧巷少年郎
    2020-12-29 07:06

    In the DBContext file, remove

    public RaficaDB()
    : base("name=DefaultConnection"){}
    

    to

    public RaficaDB()
    : base("DefaultConnection"){}
    

    EF 4.3, EF 5 and EF 6 do not like the connection string being called name=xxxxx

    Answer found here -> No connection string named 'MyApplicationEntities' could be found in the application config file

提交回复
热议问题