Skip to content

Commit

Permalink
Merge pull request #491 from Particular/hotfix-4.1.3
Browse files Browse the repository at this point in the history
Fixed startup check message and included original error.
  • Loading branch information
SzymonPobiega authored Jun 12, 2019
2 parents 5e7fbb0 + b24e09f commit a77e9ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/NServiceBus.SqlServer/SqlServerTransportInfrastructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,15 @@ async Task<StartupCheckResult> CheckForAmbientTransactionEnlistmentSupport(SqlCo
scope.Complete();
}
}
catch (NotSupportedException)
catch (NotSupportedException ex)
{
var message = "The version of System.Data.SqlClient in use does not support enlisting SQL connections in ambient transactions, so the TransactionScope transport transaction mode cannot be used. Use `EndpointConfiguration.UseTransport<SqlServerTransport>().Transactions` to select a different transport transaction mode.";
var message = "The version of System.Data.SqlClient in use does not support one of the selected connection string options or " +
"enlisting SQL connections in distributed transactions. Check original error message for details. " +
"In case the problem is related to distributed transactions you can still use SQL Server transport but " +
"specify a different transaction mode via `EndpointConfiguration.UseTransport<SqlServerTransport>().Transactions`. " +
"Note that different transaction modes may affect consistency guarantees as you can't rely on distributed " +
"transactions to atomically update the database and consume a message. Original error message: " + ex.Message;

return StartupCheckResult.Failed(message);
}
}
Expand Down

0 comments on commit a77e9ae

Please sign in to comment.