Click here to Skip to main content
15,902,863 members
Articles / Programming Languages / C#

Step By Step Guide to Setup .NET Core 1.0 Development Playground in Windows OS Family

Rate me:
Please Sign up or sign in to vote.
3.75/5 (3 votes)
25 Aug 2016CPOL4 min read 13.6K   6   3
Setting up .NET Core 1.0 development playground in Windows OS family

This post shows you how to set up .NET Core 1.0 development playground in Windows OS family.

1. Prerequisites

  1. Windows OS, I preferred to create a Windows 10 VM in AZURE. If you want to get AZURE subscription, then signup for Visual Studio Dev Essentials. Once you sign up, you will get too many goodies free of cost including Pluralsight subscription.
  2. To know more about this, check the below link:
    https://www.visualstudio.com/en-us/products/visual-studio-dev-essentials-vs.aspx
  3. I have created a Windows 10 Enterprise N (x64) VM machine and connected using Remote Desktop from my personal laptop.
  4. Next is to get NodeJS from the below url:
    https://nodejs.org/en/
  5. I have installed stable version of nodejs "v4.4.7 LTS" if you like to have the latest, then install the available latest version, now its "v6.3.0"

2. Download and install VS Code latest version from the below url

3. Install .NET CORE from the below url, as we have planned to use only VS code, then I need to download and install only ".NET Core SDK for Windows"

4. Now, we need to have boilerplate applications to start with, for this, we have 2 options

  1. Using Yeoman command line tool to create .NET core web application
  2. Using Yeoman extension in VS code

5. Let's start with the command line first

  1. Open Windows command prompt as administrator and try to install prerequisites.
  2. First of all, check that Node is installed properly, just run the below command, command will show many options as below:
    npm version

    www.rajneeshverma.com

  3. I am suggesting to run the below command to ensure that I have the latest NPM in my machine:
    npm update
  4. The next step is to install yeoman, grunt, gulp & bower using npm command as below:
    npm install -g yo bower grunt-cli gulp

    Here, -g denotes global, installing tools globally so that can be used for all applications.

    Note: If you face error related to access, then run command as Administrator.

  5. Now, we need to install aspnet generator using npm:
    npm install -g generator-aspnet
  6. Now that all prerequisites have been installed, let's create a new directory and move to it using the below commands:
    mkdir MyFirstApp
    cd MyFirstApp
  7. Run the below command, it will show you 7 different options to create 7 different types of applications as below:

    www.rajneeshverma.com

  8. For me, I have selected "Web Application" using down arrow and pressed enter, it asked me to select UI framework either "Bootstrap" or "Semantic UI", for now I have selected "Bootstrap and pressed enter.
  9. Now prompted for a name of my app, I have given as "TestApp" and clicked enter, once application created in the console, it will show all necessary commands to be executed for running currently application.

    www.rajneeshverma.com

  10. Just follow as command available:
    cd TestApp - (to navigate to TestApp Application)
    dotnet restore - (command to restore packages for the application)
    dotnet build - (command to build the application, not mandatory to the application, 
    once run it will be build first)
    dotnet run - command to run the asp.net core 1.0 application using command

    www.rajneeshverma.com

  11. In the above screen, you can see that application is running and is listening to localhost with 5000 port, open browser and type: http://localhost:5000
  12. Our now website is running as below, once need to stop, in command prompt pressing "Ctrl +C" will allow to shut down the application.

    www.rajneeshverma.com

6. Let's try our second option "using Yeoman extension in VS Code"

  1. Open Visual Studio Code, go to File - > Open Folder and select folder "C:\VSCode"
  2. Now we have to install Yeoman extension for VS Code, Press Ctrl + Shift + X will provide option to search extension from market place, put yo in search box and install yo extension once appears.

    www.rajneeshverma.com

  3. Once installed, it will ask to Enable extension, click on it will restart VS Code.
  4. Again press Ctrl + Shift + X and select C# extension and install it, Once installed Enabled and restart VSCode.
  5. Now press F1 will open actions textbox, type yo and press enter.
  6. Next will show as below:
    aspnet Yeoman generator for ASP.NET  Core App
  7. Now, it will show different options to select an template, select *App will again popup with other options as below:

    www.rajneeshverma.com

  8. I have selected "Web Application", it ask to select UI Framework, Selected Bootstrap and given application name as "TestAppUsingVSCode" in the next stage.
  9. Once project created successfully, we can see Done option in Output window.

    www.rajneeshverma.com

  10. Now click on File -> Open Folder.. and select newly created application "TestAppUsingVSCode" and click on Select Folder button.
  11. Now newly created application is loaded in VS Code and Once loaded there will be 2 notifications on the screen, one to restore the dependencies and other to add required assets to build and debug.

    www.rajneeshverma.com

  12. Click restore and yes for both the options.
  13. Once restore complete the completes status will be shown in the output window.

    www.rajneeshverma.com

  14. Now press F5 to run the application in debug mode. Application may ask to choose a browser to run the application, please select one you want to run the application. For me I have chosen Edge browser.

    www.rajneeshverma.com

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Microsoft Certified Solutions Associate - Cloud Platform || MCSD - App Builder || MCSA - Web Applications || Microsoft Community Contributor (MCC)
A fond lover of Microsoft .NET Technologies including ASP.NET MVC, AZURE etc.

Comments and Discussions

 
PraiseGreat Pin
FM195525-Aug-16 4:23
FM195525-Aug-16 4:23 
GeneralRe: Great Pin
Rajneesh Kumar Verma25-Aug-16 4:40
professionalRajneesh Kumar Verma25-Aug-16 4:40 
Thank you Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.