Sunday, August 12, 2018

Minimal ASP.NET Core Dependencies for Google Cloud

After a long hiatus, I'm slowly starting back on blogging and some personal projects. To get me back in the swing of things, here's a short post on running ASP.NET core on Google Cloud, since this seems poorly documented online.

The default project created by the Google Cloud tools includes Microsoft.AspNetCore.All which is a huge dependency. If you want something more minimal:

  1. uninstall-package Microsoft.AspNetCore.All
  2. install-package Microsoft.AspNetCore
  3. install-package Microsoft.AspNetCore.Mvc.Core
  4. install-package Microsoft.AspNetCore.Mvc

This creates a runnable project using the standard Google Cloud Web API project template, although it still isn't ideal as it includes the Razor pages dependencies.