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

前端 未结 8 1045
故里飘歌
故里飘歌 2020-12-03 00:34

I just install EF 4.3 and trying to upgrade my project with migration. however I am getting issues with trying to execute add-migration initial to my project vi

8条回答
  •  囚心锁ツ
    2020-12-03 01:01

     1. ctor => Context
    
       public MasterEntities()
        : base("ConnectionStringName")
    {
    }
    
     2. config file
    
       
    
     3. in Sulation Exporer right click the project and select 'Set as
        startup project'
    
     4. in PackageManagerConsole Change Default Project to Your Project of
        context class.
    
     5. then:
    
    add-migration new
    

    or added ConnectionString to config file of working Project.

提交回复
热议问题