.NET Overview (5, 6)

Tram Ho

1. What is the .NET Framework?

  • The .Net Framework is a framework released by Microsoft in 2001 for building applications on the Windows platform .
  • Can build web application, winform, webform, web service, wpf using .Net Framework.
  • The current version of the .net framework is .NET Framework 4.8 and Microsoft currently has no plans to release a new version (4.9).
  • .NET Framework is closed source (no microsoft public source code outside)

2. What is .NET Core?

  • .NET core is a framework released by Microsoft in 2016 for building applications on multiple platforms (window, linux and macOS).
  • Can build Desktop applications (WPF, Winform), websites, mobile, games, IoT and even AI.
  • Versions of .NET Core: (since .net 5 (2020) microsoft has dropped the word core and collectively called .NET), encouraging the use of LTS (Long term support) versions supported by MS for a long time. image.png
  • .NET core is open source (open source) and the source code is public on github, programmers can come in to contribute to the development to make the source code better. image.png

3. Advantages of .NET core (.NET 5, 6) compared to .Net Framework

  • .NET Core supports building cross-platform applications (window, linux, MacOS), .NET Framework only supports on windows.
  • .NET Core was born later, so Microsoft released new versions continuously, updated every year (in the future), .NET Framework was born long and Microsoft stopped updating new (large) versions.
  • .NET Core is faster and lighter than .NET Framework
  • .NET Core does not need to download the entire framework, just install the SDK and when needed, the download package should be lighter. .NET Framework must install the entire framework with full libraries on windows, so it is very heavy.
  • .NET Core is open source so developers (developers) can contribute to make the source code better.

4. Installing .NET 6

5. Create and run your first application with .NET 6

image.png

  • Web Apps image.png image.png image.png image.png
  • Run the app image.png

6. Web Application Components with .NET 6

image.png

  • For example with launchSettings.json we can configure applicationurl or add profiles according to each environment (development, staging, production) image.png
  • Program.cs main file that runs the program when running the application. Contains declaration of services, config, middleware…

image.png

(app.run runs the app)

Note: This section is only an overview, so it will not explain in detail about environment variables, middleware, razor page or other detailed concepts…

7. Razor pages

  • Razor is a component in .NET that allows us to easily build interfaces using c# code in HTML files.
  • Razor files contain .cshtml extension (including c# and html code)
  • Razor engine will help turn razor files into html files that the browser can understand.
  • To use razor page we add configuration image.png

Refer to how to use razor page: https://learn.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/model?view=aspnetcore-6.0&tabs=visual-studio

Refer

 

Share the news now

Source : Viblo