![]() We need to do this to provide the EF tools with the additional information dotnet exec is responsible for running the command.Let’s take a look at these lines individually. csproj file after publishing, we have to tell dotnet where to find csproj file, it gathers all the dependencies When you run your EF commands from your development machine with the. So now what? Turns out we need to be a little more verbose with our command: # Note: I broke this up into lines to make it easier to read and explain $ dotnet exec \ -depsfile \ -runtimeconfig \ "/opt/ef-tools/ef.dll" database update \ -assembly MyApiProject.dll \ -startup-assembly MyApiProject.dll \ -root-namespace MyApiProject I’d gladly specify a project file, but since the app has been published already, it doesn’t exist Change the current working directory or use the -project option. If we run the same database update command, we get an error: $ dotnet ef database update No project was found. In my case, there’s a hook in the appspec.yml file to execute the migrations.įor example purposes, we’re going to assume my application was deployed to my Linux server at /var/www/html/api and this will Since Code Deploy relies on the above artifact being in an S3 bucket, put the file in the appropriate S3 bucket. ~įrom your development machine or build server, publish your application and zip it up: $ dotnet publish -c Release I’ll cover the details of each step in a later blog post (or hopefully series). High-level steps to deploy this application. Like most CI/CD systems, this is intended to be fully automated. Trying to deploy my application using AWS Code Deploy. Where I ran into issues however, is while ~That’s because the EF tools are installed on your system and easily accessible. NuGet package installed in your project. Note that to use the dotnet ef command, you must either have version 2.1+ of the. Running Entity Framework Core database migrations on Linux after publishing is not as easy.ĭuring development, running migrations is as simple as always: $ dotnet ef database update As you’ve probably heard, ASP.NET Core runs on Linux (and macOS)! And it’s actually pretty easy to get started.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |