簡體   English   中英

vNext EF7代碼首先遷移。 無法加載一種或多種請求的類型

[英]vNext EF7 code first migration. Unable to load one or more of the requested types

我決定學習一個新的asp.net。 我開始寫書,做了一個模型,我想做移植,我看到了:

在控制台中:

c:\...>k ef migration add init_pracownicy -c PracownicyDbContext

然后返回:

    k : System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the 
LoaderExceptions property for more information.
At line:1 char:1
+ k ef
+ ~~~~
    + CategoryInfo          : NotSpecified: (System.Reflecti...re information.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Ru
ntimeAssembly.get_DefinedTypes()
   at Microsoft.Framework.Runtime.Common.EntryPointExecutor.TryGetEntryPoint(Assembly assembly, IServiceProvider 
serviceProvider, Object& instance, MethodInfo& entryPoint)
   at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider 
serviceProvider)
   at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Framework.ApplicationHost.Program.Main(String[] args)

我在Google中搜索,但未找到答案。 (也許不好看)。 請一些幫助。

這意味着加載的程序集和引用的程序集不匹配。

有多種可能的解決方案。

  1. 如果您使用Debug模式進行編譯,並嘗試從發行版中部署較舊的dll(反之亦然),則只需檢查並確保使用相同的目錄進行構建和部署
  2. 嘗試在項目引用中將“復制本地”屬性設置為“ true”

我安裝了VS2015 CTP。 我創建了一個新項目。 那就是我已經寫的對新項目的重寫。 一切正常。 問題解決了。 (我以前有vs2015預覽版)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM