Showing posts with label dotnet. Show all posts
Showing posts with label dotnet. Show all posts

Saturday, April 23, 2022

ReactJS Part 7 .Net Core React Project

 Create-React-App is an excellent option for creating a new React application. Other options also exist. .Net React project can be considered if .Net Core Web API is the REST option for React. It handles a lot of plumbing issues for the developer. The routing is also configured.

 

In this blog I am going to handle the .Net CLI way of creating an .Net Core React application. My favorite editor is Visual Studio Code which comes with a good collection of useful extension. Any editor can be used.  The same is possible with Visual Studio also which I will handle on another blog. 


dotnet new react -o corereact


Inside the ClientApp folder is the ReactJS project.

 


 The .Net Core React Project comes packed with a few components. Notably the NavMenu.js comes with reacter-router.

 


 



Tuesday, October 11, 2016

Asp .Net Core Part 1 : dotnet tool and Console application


Asp .Net Core is an cross platform and open source MVC framework from Microsoft. Asp .Net core is characterized by  low memory footprint.


First let's create a Console application with Asp .Net Core.  Asp .Net Core gets  installed as a part of Visual Studio Update 3.
Asp .Net Core is not tied to Visual Studio. You can use any editor for creating Asp .Net Core Application.

Here I am going to demonstrate creating a simple Console application using dotnet tool.

 I can go to command prompt and type dotnet --help.


dotnet  is the .Net Command Line Tool.

For creating an new project we can use the comman dotnet new.


The project is having two files: Project.json and Program.cs.

Project.json file is having all the dependencies. 

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      },
      "imports": "dnxcore50"
    }
  }
}

Program.cs is having the actual code.

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

dotnet restore command is used to restore the project with dependencies form Nuget based on the entries in Project.json,

We can see the output with dotnet run command.