从powershell为Cloud Services Project运行migrate.exe?

时间:2016-08-18 21:35:03

标签: entity-framework powershell ef-migrations azure-cloud-services

我正在尝试编写一个运行云服务项目迁移的PowerShell脚本:

$migrator = "C:\Path\EntityFramework.6.1.3\tools\migrate.exe" 
$migrateCommand = "$migrator file.dll /StartUpDirectory=C:\path\bin\Test /connectionStringName:myconnection /startUpConfigurationFile:C:\path\app.config /verbose"  
Invoke-Expression $migrateCommand

当我运行脚本时,我不断收到以下错误:“未处理的异常:System.IO.FileNotFoundException:无法加载文件或程序集'EntityFramework,Version = 6.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或它的一个依赖项。系统找不到指定的文件。“

我已将migrate.exe复制到我的bin文件夹,其中所有的dll都是,我正在使用startupdirectory和配置文件的绝对路径。似乎无法弄清楚我错过了什么?另外一个问题是migrate.exe只能用于webrole / workerrole项目吗?

1 个答案:

答案 0 :(得分:0)

问题是迁移者在同一个工作目录中搜索entityframework.dll。您可以将工作目录更改为包含entityframework.dll的文件夹

相关问题