最近在學習項目的時候(vs2013,ef5.0.0),在tools->nuget package manager->package Manager console裡面,就是指令行中敲指令enable migrations時
彈出了下面的錯誤:
pm> enable-migrations system.io.filenotfoundexception: could not load file or assembly
'microsoft.visualstudio.shell, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or one of its dependencies. the system cannot find the file specified.
最終還是在stackoverflow上找到了解決問題的方法:
下載下傳并安裝:microsoft visual studio 2012 shell
redistributable package (isolated)即可,下載下傳位址請戳:https://www.microsoft.com/en-us/download/details.aspx?id=30670
下載下傳了之後再運作指令就沒問題了。
但是這時候可能會遇到另外一個問題,vs2013無法關閉了!!!每次想關閉的時候點選右上角的x都會提示:
居然ms的官網上都沒有解決的辦法。最終還是萬能的stackoverflow解救了我:
had the same issue, adding the following line to my system path variable and restarting visual studio did the trick.
c:\program files (x86)\microsoft visual studio 11.0\team tools\performance tools
我當時安裝上面那個isolate的package的時候沒有選擇預設路徑,而是自己安裝在d盤下了,找到那個檔案的路徑,然後複制到path就好了。如果不知道path怎麼添加請自行google
但是這個不是立即生效的,需要重新啟動一下電腦才能生效。這樣整個vs2013就沒有問題了,正常工作!