3

I am trying to use migrate.exe in my work project and i'm getting the following error.

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.Entity.Migrations.Console.Program.Main(String[] args)

The Command:

d:\Publish\bin>migrate.exe Example.Data.dll /connectionProviderName:"System.Data.SqlClient" /connectionString: "Data Source=(local);Initial Catalog=ExampleDb;Integrated Security=SSPI;MultipleActiveResultSets=true" 

The migrate.exe and the migrate.exe.config file are kept in the bin folder of the Publish while executing this command.

I have gone through this stackoverflow question and also this msdn link but am not able to figure out what is missing.

I created a test console project and was able to execute the process successfully with similar configurations except that instead of dll it was an exe.

Any help appreciated. Thank You.

Community
  • 1
  • 1
Pazza22
  • 554
  • 3
  • 18
  • Assuming the colon instead of equal and the white space don't matter? I only ask since the error indicates a parameter issue. – Steve Greene Mar 03 '15 at 14:40

1 Answers1

0

Try to use startupDirectory parameter as it is described here: https://msdn.microsoft.com/en-us/data/jj618307.aspx

Andriy Kozachuk
  • 743
  • 1
  • 13
  • 27