0

I am using entity framework 6 with code first. During deployment I need to make an update across and existing linked server. When I try this I get:

"MSDTC on server 'myLocal' is unavailable."

This problem happens when running agianst my local instance. MSDTC is not enabled on that instance but I have no trouble running this update manually in SQL Server. I don't want every developer to have to enable MSDTC for this one command.

I have tried adding this as a migration using a DbMigration.Sql and I get the error. I have also tried it in the seed method of DbMigrationsConfiguration using context.Database.ExecuteSqlCommand and I get the error.

Don Chambers
  • 3,798
  • 9
  • 33
  • 74

1 Answers1

0

ADO.NET Transaction scopes that go across servers - including linked servers - will automatically start the Distributed Transaction Coordinator (DTC). I think your best bet is to update the other database with a direct call in the migration, rather than through the linked server.

sfuqua
  • 5,797
  • 1
  • 32
  • 33