This blog post explains how when a .Net Core website is hosted in IIS, the website code does not actually get run until the first request comes in to IIS:
I tried the solution above by @eric, and it didn't work by itself. Adding this to my .CSPROJ file (in addition to his suggestions) finally did the trick: