Skip to content

Instantly share code, notes, and snippets.

@jzlin
Last active April 6, 2017 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzlin/829d09af71e48365319ac8662ee3f5ef to your computer and use it in GitHub Desktop.
Save jzlin/829d09af71e48365319ac8662ee3f5ef to your computer and use it in GitHub Desktop.
AspNetCore with Angular Environment Setup

Prerequistes

Getting started

  1. To install the Single Page Application (SPA) templates, run the following command:
    dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
    

Template list for the “dotnet new” command

  1. Create Project with dotnet CLI

    cd ./project-folder-path
    dotnet new angular
    
  2. Restore Project

    dotnet restore
    npm install
    
  3. Set an environment variable to tell ASP.NET to run in development mode:

    • If you’re using PowerShell in Windows, execute $Env:ASPNETCORE_ENVIRONMENT = "Development"
    • If you’re using cmd.exe in Windows, execute setx ASPNETCORE_ENVIRONMENT "Development", and then restart your command prompt to make the change take effect
    • If you’re using Mac/Linux, execute export ASPNETCORE_ENVIRONMENT=Development
  4. Run & Open localhost:5000

    dotnet run
    

Invoking Webpack manually

webpack --config webpack.config.vendor.js 
webpack

Referrences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment