Building an ASP.NET Core Starter App on MacOS (Intro)

I teach as a side gig to my day job at SPR.  It’s just one class at the university that I attended.  This past spring semester was my second attempt.  The whole experience is very rewarding (obviously), but what really makes it special is that it’s a section of the capstone for the Computer Science department – the last class the students have to take (and pass) in order to graduate.  The students plan a project for a real client in the fall and build it in the spring.  Clients are generally small businesses, non-profit/not-for-profit organizations, or charities.  The business problem and technologies change each semester.

This past semester we built an app intended to be used by the university’s theater department to inventory costumes and set pieces for the different shows they perform.  Eventually, the goal was to share the app with other universities and local theater groups so that when costumes and set pieces are lent/borrowed between organizations they are more easily tracked.  We built this project using ASP.NET Core MVC.  As someone with very little C#/.NET development experience, and with myself and several others in the class using Apple laptops as development machines, we ran into some interesting challenges and addressed what I perceived to be shortcomings in the Microsoft tutorials and starter app examples.  We pieced together many solutions that I feel are worth sharing for others getting started in ASP.NET Core development outside of the traditional Windows/Visual Studio development toolchain and/or are used to some of the pre-configured tooling of other frameworks.

This post is the first in a series that will cover details and examples of:

  • getting a project up and running
  • swapping out default tools (replacing jQuery and Bootstrap with Vue.js and Bulma)
    • building simple front-end components within Razor templates using Vue.js
  • building testable/customizable authentication and authorization components
  • Integration/unit test configuration

This isn’t an endorsement of the tools that we used to replace the defaults.  Any tools can be used – including the defaults.  My goal in writing this series is to share what we learned when moving away from defaults and how we built the pieces of what we consider a more robust “starter app”, one more conducive to modern developer workflow.  We also happened to do a significant amount of work outside the typical toolchain and learned a bunch of lessons for that reason as well.  If you’re using an alternative development platform and figuring out where to start when building an app using tools/frameworks other than the defaults, this series is for you.

First, how we got here…

Visual Studio for Mac just doesn’t have the same functionality as Visual Studio for Windows.  I understand why, but it seems many tutorials involve code generation using options not available outside of Visual Studio for Windows.  This includes Visual Studio for Mac, but also the dotnet command line tools.  A great example is scaffolding authentication and authorization with overrides for custom views.

I wasn’t able to find a lot of material on unit testing services and other code that relies on Identity and Entity Framework components.  Specifically difficult was locating information on mocking.  I was able to find tutorials for integration testing, but even then functionality I’m used to from other frameworks (migrations before test executions, configuration of set-up and tear-down through annotations, etc) required a decent amount of configuration.

A scaffolded ASP.NET Core MVC app doesn’t include any tooling for relatively modern front-end development including managing front-end dependencies and assembly/minification of static assets.

Before we get started, like many other posts, I stood on the shoulders of many giants to build these examples.  I’ll include links to their sites/posts and standard documentation wherever I can.  Thanks to all those people for all their work.  Hopefully this series will be another meaningful contribution to the community.  Code supporting these posts is located here: https://github.com/jrodenbostel/example-web-application.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s