I needed to make some updates to http://LoECDA.com. This is an asp.net core app, using EFCore running inside of a docker container hosted in Azure. Cool! All things I’ve been meaning to really dig my teeth into but just haven’t quite gotten around to it. The first problem I ran into was trying to enable db schema migrations. I followed the tutorial at https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations. Fantastic docs btw. However, when it came time to add my initial migration, I ran:
dotnet ef migrations add InitialCreate
and got the following error:
Could not load file or assembly ‘Microsoft.EntityFrameworkCore.Design, Culture=neutral, PublicKeyToken=null’, The System cannot find the file specified.
Quick look at my csproj showed:
<DotNetCliToolReference Include=”BundlerMinifier.Core” Version=”2.2.301″ />
<DotNetCliToolReference Include=”Microsoft.EntityFrameworkCore.Tools.DotNet” Version=”1.0.1″ />
Hmmm… that looks right… Oh… wait.. I need to actually install Microsoft.EntitnyFrameworkCore.Tools!!! Ok…, right click csproj, manage nuget packages and install Microsoft.EntityFrameworkCore.Tools…
Now let’s run dotnet ef migrations add InitialCreate from the command line… aaaaaand voila! Initial Migration succeeded!