Tuesday, 4 January 2022

How to add the last version of LocalDB to Azure Devops Pipeline

How to add the last version of LocalDB to Azure Devops Pipeline

1. Add [Command line] Step to Pipeline and name it "Upgrade LocalDB"
2. Add this commands to the new step:
  1. SqlLocalDB stop
  2. SqlLocalDB delete
  3. choco upgrade sqllocaldb
  4. SqlLocalDB create
  5. SqlLocalDB start
  6. SqlLocalDB share MSSQLLocalDB MSSQLLocalDB
  7. SqlLocalDB info MSSQLLocalDB
  8. SQLCMD.EXE -S (localdb)\MSSQLLocalDB -Q "SELECT @@VERSION;"

Known issues:
In some cases the .NET Code cannot connect the LocalDB.
If LocalDB is used in .NET Core Services, then add EnableRetryOnFailure to UseSqlServer call

No comments:

Post a Comment

Note: only a member of this blog may post a comment.