Kar*_*ran 12 migration asp.net-mvc entity-framework-4
我一直在努力执行EF Migrate.exe.
我的解决方案有几个项目.迁移和实体存在于项目数据中.控制器和视图存在于Web中.
我尝试使用migrate.exe - 但是我正在努力让第一个参数(程序集)被接受.文件说:
程序集:指定包含迁移配置类型的程序集的名称.
我试过了:
migrate.exe"MySolution\DataProject\bin\Debug\Data.dll"
ERROR: Could not load file or assembly 'D:\\MySolution\\Data\\bin\\Debug\\Data' or one of its dep
endencies. The given assembly name or codebase was invalid. (Exception from HRES
ULT: 0x80131047)
Run Code Online (Sandbox Code Playgroud)
什么出了什么问题?
Zas*_*asz 33
我(我认为)你需要什么:
C:\Tools\migrate.exe some.dll /StartUpDirectory=C:\Project\bin\.C:\Tools\migrate.exe C:\Project\bin\some.dll- 在这种情况下,migrate.exe将无法加载some.dll的依赖项,除非您放置所有some.dll的依赖项并将其作为migrate.exe放在SAME目录中.C:\Tools\migrate.exe some.dll/StartUpDirectory=<the path where you target dll is present>子句,你应该指定程序集的名称路径如:C:\Tools\migrate.exe some.dll /StartUpDirectory=C:\Project\bin\$SolutionPath = (Resolve-Path '..').Path
$ToolsPath = "$SolutionPath\Build\Lib\"
task db {
$migrator = $ToolsPath + 'Migrations\migrate.exe'
$migrateCommand = "$migrator zasz_me.dll /StartUpDirectory=$SolutionPath\zasz.me\bin\ /connectionStringName:FullContext /startUpConfigurationFile:$SolutionPath\zasz.me\Web.config /verbose"
Write-Host $migrateCommand
Invoke-Expression $migrateCommand
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7781 次 |
| 最近记录: |