Enterprise Framework

Software Solutions in the Enterprise

Change of Email on Github causes Mac Bash Permissions Connection Issue

Change of Email on Github causes Mac Bash Permissions Connection Issue

If you change your email on Github it will cause your previously saved Github credentials on Mac to become invalid because it was cached in the Keychain Access.  When you try to connect to github, it thinks the password is valid and tries to use it for your Github access.  You'll need to delete it.


Make sure to change your local git config global user.email

$ git config --global user.email "your.email@domain.com"

Just go to Keychain Access (Command + Space) and type Keychain Access.

Find the github.com name in the list where kind is Internet Password and delete it.  

From command again try connecting to Github and should prompt you for the updated password associated to the new email.

Angular 5 to 6 Upgrade Migration with Error Fixes

Angular 5 to 6 Upgrade Migration

  • Go to https://update.angular.io/ to generate steps for upgrade.
  • Switch HtpModule and Http to HttpClientModule and HttpClient
  • Make sure you're using Node 8 or later
  • Run the commands
    • ng install -g @angular/cli
    • ng install @angular/cli
    • ng update @angular/cli
    • ng update @angular/cli (Yes this was intended.  Run it twice, I think there is a bug with update).  This will cause angular-cli.json to be updated (Renamed) to angular.json and keep you from getting the error:  Local workspace file ('angular.json') could not be found.
  • ng update @angular/core
  • ng update @angular/material
  • ng update
  • ng update
  • rxjs-5-to-6-migrate -p src/tsconfig.app.json
  • Remove deprecated RxJS 6 features using rxjs-tslint auto update rules.  If you don't you'll get errors like node_modules/rxjs/BehaviorSubject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/BehaviorSubject'.
    • npm install -g rxjs-tslint
    • npm install --save rxjs-tslint
  • Add rules to tslin.json
    • {
        "rulesDirectory": [
        "rules": {
          "rxjs-collapse-imports": true,
          "rxjs-pipeable-operators-only": true,
          "rxjs-no-static-observable-methods": true,
          "rxjs-proper-imports": true
    • Lint the project by executing
      • ./node_modules/.bin/tslint -c tslint.json -p tsconfig.json
      • If you get the error Error: Cannot find module 'typescript', run npm install -g typescript then re-run 
        • ./node_modules/.bin/tslint -c tslint.json -p tsconfig.json
  • Once you all all of your dependencies have update to RxJs, remove rxjs-compat

ASP.NET Core - Entity Framework - Code First Add-Migration - Unable to resolve service for type Microsoft.EntityFrameworkCore.Migrations.IMigrator.

Entity Framework Error:

Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Migrations.IMigrator'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.


Verify the connectionstring in the appsettings.json file.

  "ConnectionStrings": {
    "CustomerDb":  "Server=(localdb)\\mssqllocaldb;Database=Customer;Trusted_Connection=True;"
On Startup.cs, ConfigureService method, verify, you are correctly initializing the Context

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
            services.Configure<CookiePolicyOptions>(options =>
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;

            services.AddDbContext<AppDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("CustomerDb")));


How To: Unobtrusive Javascript - Manually Add Required Rule and Message.

How To: Unobtrusive Javascript - Manually Add/Remove Required Rule and Message.  

<script type="text/javascript">
$(function () {

var addRequired = function () {
// Manually add required fields to certain fields
$('#scheduledLockDate').rules('add', {
required: true,
messages: {
required: "The Scheduled Lock Date is required"
$('#scheduledDisposeDate').rules('add', {
required: true,
messages: {
required: "The Scheduled Dispose Date is required"
$('#issueDate').rules('add', {
required: true,
messages: {
required: "The Issue Date is required"

// This will remove the manually required fields
var removeRequired = function () {
// Manually remove required fields to certain controls
$('#scheduledLockDate').rules('remove', 'required');
$('#scheduledDisposeDate').rules('remove', 'required');
$('#issueDate').rules('remove', 'required');

// Handle the form submit method
$('#workspaceForm').submit(function (e) {
var form = this;

// Trigger Form Validation
var isValid = $('#workspaceForm').valid();

if (!isValid) {
// Exit out
return false;


//Manually add the required fields

//Manually remvoe the required fields
Reference:  https://jqueryvalidation.org/rules/

Add Google Maps and restrict to specific urls

Goto:  https://console.developers.google.com/apis/dashboard

Choose your domain from the top navigation dropdown


Goto:  https://console.developers.google.com/apis/library

Choose your domain from the top navigation dropdown

Not all these API are required, I just added few more for helpfulness

Enable the following:

  • Maps Javascript API
  • Maps Embed API
  • Directions API
  • Places API
  • Geocoding API
  • Geolocation API

Choose Restrictions

Choose Referers

Enter the urls:


MANS Stack (Mac, ASP.NET MVC, .NET Core, SQL Server 2017) - Developing on a Microsoft Stack on a Mac

MANS Stack (Mac, ASP.NET MVC, .NET Core, SQL Server 2017)

Valid as of April 18, 2018

Let's install .NET SDK for Mac.


Download Visual Studio for Mac


Download Docker for Mac


Download SQL Server 2017 Ubuntu Docker Image


NOTE:  After you pull the SQL Server 2017 Docker Image.  Run it and accept the EULA.  Exit the SQL Server 2017 Image and commit the image

$ docker ps

CONTAINER ID        IMAGE                                      COMMAN                  CREATED             STATUS              PORTS                    NAMES
cb31a41d1f1b        microsoft/mssql-server-linux:2017-latest   "/opt/mssql/bin/sqls…"   2 hours ago         Up 2 hours>1433/tcp   sql1

$ docker commit cb31a41d1f1b microsoft/mssql-server-linux:2017-latest

Running the docker image without commiting will show the error:

$ docker run microsoft/mssql-server-linux:2017-latest

The SQL Server End-User License Agreement (EULA) must be accepted before SQL

Server can start. The license terms for this product can be downloaded from


You can accept the EULA by specifying the --accept-eula command line option,

setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.

Connection String Example:

Server=,1401;Database=AppDb;User Id=sa;Password=P@ssw0rd;