Monday, March 20, 2017

Introduction to .NET Core Structure


    There are a lot of information out there about the .NET Core, Training videos by Microsoft are really useful to understand .NET Core's structure changes. Some of these changes might be overwhelming specially if you have been writing code with .NET long time.
In this article, I want to start with the basics. I want to show you what the solution explorer looks like in Visual Studio for a .NET Core solution. Rather than updating the Visual Studio 2013 or 2015, I have downloaded the Visual Studio 2017 Community Edition to create a new .NET Core project. Also keep in mind that .NET is an open source project now, and you can find its source right here.


Some of the key features/changes of .NET Core are :
  • It is Open Source
  • It is cross platform friendly.
  • It's much faster than classic .NET
  • IIS is in dying mode. There is a new server named Kestrel.
  • web.config is largely not in use.
  • HttpModules and HttpHandlers are replaced with middleware.
  • Web API is dead, it is part of MVC now

When I create a new .NET Core MVC application, my solution explorer looks like this. It's little bit different than regular .NET MVC project.
launchSettings.json
This file contains settings of your web server. NET Core has a new web server named KESTREL which can run in other operation system. You can adjust the IIS settings in this file too.




bundleconfig.json
This file controls the bundling and minification.


bower.json
This file contains all references from Bower.


WWWROOT Folder
This folder holds all your static files. (Html, CSS, JavaScript etc...)


Program.cs
We are configuring our application here. You load only what you need to run your application which is one of the reasons why .NET Core is much faster than regular .NET


Startup.cs
I am not going to go in details here, but this file acts like global.asax file to configure the application.

1 comment: