Adding a New Field to the Movie Model and Table報錯
因工作需要,學習MVC4,但是微軟官方教程中遷移版本庫步驟在本地測試報錯
PM> Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext
錯誤提示:
使用“8”個參數調用“CreateInstanceFrom”時發生異常:“Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. 系統找不到指定的文件。”
所在位置 F:\Programming\NET\MvcMovie\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:431 字元: 31
+ $domain.CreateInstanceFrom <<<< (
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodTargetInvocation
解決方法:
先執行 Install-Package EntityFramework
再執行 Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext