Repro:
Create basic console application
PM> Install-package entityframework -pre -version 6.0.0-beta1-20502
PM> Enable-Migrations
PM> Add-Migration a
PM> Update-Database
add property to entity
PM> Add-Migration b
PM> update-database
PM> update-database -targetMigration a -script
EXCEPTION:
PM> update-database -TargetMigration a -script -Verbose
Using StartUp project 'IssueMigrationsRepro101x'.
Using NuGet project 'IssueMigrationsRepro101x'.
Target database is: 'IssueMigrationsRepro101x.EntityContext' (DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).
Reverting migrations: [201305022224295_b].
Reverting explicit migration: 201305022224295_b.
System.Runtime.InteropServices.COMException (0x8004000C): User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
at EnvDTE.ItemOperations.OpenFile(String FileName, String ViewKind)
at System.Data.Entity.Migrations.Utilities.DomainDispatcher.OpenFile(String fileName)
at System.Data.Entity.Migrations.Utilities.DomainDispatcher.OpenFile(String fileName)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.NewSqlFile(Project project, String contents)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
Comments: This issue is dependent on the state of the dev machine. It shows up when the SSDT Transact-SQL editor becomes corrupted. This can be accomplished by installing git 1.8.1.2 with the "Run Git and included Unix tools from the Windows Command Prompt" option selected. If we encounter this type of failure we should write out the Sql script in a plain text file
Create basic console application
PM> Install-package entityframework -pre -version 6.0.0-beta1-20502
PM> Enable-Migrations
PM> Add-Migration a
PM> Update-Database
add property to entity
PM> Add-Migration b
PM> update-database
PM> update-database -targetMigration a -script
EXCEPTION:
PM> update-database -TargetMigration a -script -Verbose
Using StartUp project 'IssueMigrationsRepro101x'.
Using NuGet project 'IssueMigrationsRepro101x'.
Target database is: 'IssueMigrationsRepro101x.EntityContext' (DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).
Reverting migrations: [201305022224295_b].
Reverting explicit migration: 201305022224295_b.
System.Runtime.InteropServices.COMException (0x8004000C): User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
at EnvDTE.ItemOperations.OpenFile(String FileName, String ViewKind)
at System.Data.Entity.Migrations.Utilities.DomainDispatcher.OpenFile(String fileName)
at System.Data.Entity.Migrations.Utilities.DomainDispatcher.OpenFile(String fileName)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.NewSqlFile(Project project, String contents)
at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))
Comments: This issue is dependent on the state of the dev machine. It shows up when the SSDT Transact-SQL editor becomes corrupted. This can be accomplished by installing git 1.8.1.2 with the "Run Git and included Unix tools from the Windows Command Prompt" option selected. If we encounter this type of failure we should write out the Sql script in a plain text file