error loading database initializer with EF6

后端 未结 1 511
無奈伤痛
無奈伤痛 2020-12-31 05:48

I have been trying to follow this tutorial ... http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-

相关标签:
1条回答
  • 2020-12-31 06:00

    In your web.config file you have this:

    <contexts>
        <context type="WeddingPreparations.Dal.WeddingContext">
            <databaseInitializer type="WeddingPreparations.Dal.WeddingInitializer, KevinLisaWedding" />
        </context>
    </contexts>
    

    This says look for a class called WeddingPreparations.Dal.WeddingInitializer in the assembly called KevinLisaWedding. As your assembly is called WeddingPreparations you need to change the config to this:

    <contexts>
        <context type="WeddingPreparations.Dal.WeddingContext, WeddingPreparations">
            <databaseInitializer type="WeddingPreparations.Dal.WeddingInitializer, WeddingPreparations" />
        </context>
    </contexts>
    
    0 讨论(0)
提交回复
热议问题