Postgres entity framework 6 code first issue

2

Ok, here are the exact steps I followed:

  1. Installed postgres 9.3 locally, created database 'testdb', added login role with uname/pass test
  2. Installed Setup_Npgsql-2.2.3.0-r2-net45.exe from here
  3. Created a new class library (PGTest) in vs 2012, installed "npgsql for entity framework" from nuget package manager
  4. Modified app.config to match this
  5. Added Models folder, added two files: DataContext.cs and Region.cs
  6. In package manager console ran "enable-migrations", "add-migration Initial", "update-database -script"
  7. Got the following error
PM> update-database -script
Applying explicit migrations: [201501282207413_Initial].
Applying explicit migration: 201501282207413_Initial.
System.Runtime.InteropServices.COMException (0x8004000C): User canceled out of save dialog (Exception from HRESULT: 0x8004000C (OLE_E_PROMPTSAVECANCELLED))

Server stack trace: 
   at EnvDTE.ItemOperations.OpenFile(String FileName, String ViewKind)
   at System.Data.Entity.Migrations.Utilities.DomainDispatcher.OpenFile(String fileName)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   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))
npgsql
asked on Stack Overflow Jan 28, 2015 by user433342

1 Answer

0

In visual studio, going to SQL menu, Transact-SQL Editor, New Query... It gives you a dialog about the tools not working with the server installed. Installing SQL Server Data Tools - December 2012 update (http://msdn.microsoft.com/en-us/jj650015) fixed the problem.

The dialog should provide you a link to the SQL Server Data Tools.

answered on Stack Overflow May 18, 2015 by F.Alves

User contributions licensed under CC BY-SA 3.0