Using the VSTS Version Definition to Start Entity Framework Object Database Migration

I am writing a basic .NET Core application and Entity Framework using code-first transformations.

I want to be able to deploy it in an Azure web application using the build and definition commands Team Team Team Visual Studio

I want to be able to start database migration as part of a release definition using a script

dotnet ef database update

I did this using the command line action in the release definition

However, I always get a message

No executable found matching command "dotnet-ef"

I tried to make sure that this command is running in the same directory as the .cproj file

I also tried running

dotnet restore 

as the previous command line task and this gives an error

The folder 'C:\a\r1\a\Drop\s\src\xxxxx' does not contain a project to restore even though it does.

Has anyone tried the first code migration as part of the Team Services release determination phase?

-, Release, .

+6
1

Hosted VS2017 . :

:

<ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.1" PrivateAssets="All" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
  </ItemGroup>
  1. / (: dotnet; : --version)
  2. / (: dotnet; : restore)
  3. / (: dotnet; : ef --version)
  4. Hosted VS2017.
+2

Source: https://habr.com/ru/post/1016359/


All Articles