7.17.2018

Updating your EF models using Database First approach

In the .Net Core world, updating your Entity Framework Core models from a Database First approach is not very obvious. It certainly wasn't obvious to me. In the not so distant past, the process of adding or updating a table involved dragging or selecting the objects onto a convenient little canvas. This is still available, I believe, in Entity Framework non core versions. 

I find myself having to copy and paste this in to the Package Manager Console so often that I needed to put this somewhere easily retrievable - so here it is.
Scaffold-DbContext "Data Source=Blah;Initial Catalog=DataBase;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -force -OutputDir Models/DB

7.10.2018

.Net Core 2.1 Install on IIS

When trying to install a .Net Core 2.1 web application, you will need the .Net Core hosting bundle.  I found this out the hard way on a Tuesday night at ~11pm trying to deploy a web application.  Follow the instructions here:
Install the .NET Core Hosting Bundle
Install the .NET Core Hosting Bundle on the hosting system. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module creates the reverse proxy between IIS and the Kestrel server. If the system doesn't have an Internet connection, obtain and install the Microsoft Visual C++ 2015 Redistributable before installing the .NET Core Hosting Bundle.
Navigate to the .NET All Downloads page.
In the Runtime column of the table, select the latest non-preview .NET Core runtime from the list (X.Y Runtime (vX.Y.Z) downloads). The latest runtime has a Current label. Unless you intend to work with preview software, avoid a runtime with the word "preview" or "rc" (Release Candidate) in its link text.
On the .NET Core runtime download page under Windows, select the Hosting Bundle Installer link to download the .NET Core Hosting Bundle installer.
Run the installer on the server.
Important! If the Hosting Bundle is installed before IIS, the bundle installation must be repaired. Run the Hosting Bundle installer again after installing IIS.
To prevent the installer from installing x86 packages on an x64 OS, run the installer from an administrator command prompt with the switch OPT_NO_X86=1.
Source: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.1&tabs=aspnetcore2x

Make sure you have the correct features and services installed...