因工作需要,學(xué)習(xí)MVC4,但是微軟官方教程中遷移版本庫步驟在本地測(cè)試報(bào)錯(cuò)
官方教程地址:http://www.asp.net/mvc/overview/older-versions/getting-started-with-aspnet-mvc4/adding-a-new-field-to-the-movie-model-and-table
PM> Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext
錯(cuò)誤提示:
使用“8”個(gè)參數(shù)調(diào)用“CreateInstanceFrom”時(shí)發(fā)生異常:“Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. 系統(tǒng)找不到指定的文件。”
所在位置 F:/PRogramming/NET/MvcMovie/packages/EntityFramework.5.0.0/tools/EntityFramework.psm1:431 字符: 31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodTargetInvocation
解決方法:
先執(zhí)行 Install-Package EntityFramework
再執(zhí)行 Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注