What is New in .Net 5


What is new in Asp.Net 5

  1. In the Program.cs, there is no Main Function, NameSpaces, just top-level code that is it. Just use Host.CreateBuilder() if you are following .Net Core way of implementing Startup.cs class in Program.cs Class File.

  2. Publish: You can now publish as a single file
    - You don't need to install .Net on the Server to run an exe file.
  3. When Trying and Catching the Errors, you can now just throw unlike throw variable
    just: throw that is it. No variable needed
  4. Analyzer: You can now get a deep level analyzer of your code by including the code below in the csproj file.
    <AnalysisLevel>5</AnalysisLevel>?

     

  5. Warning Level: You can include an .editorConfig file inside your project at the root of your project and define the configuration for warnings or errors.
    - Create a folder at the root of your project and add the .editorConfig file in the folder. Define your configuration in that file such as Warning Levels e.t.c.
    - In the configuration file, you can now add a copy righted infor to C# files, the info travels with the file. See example below:
    e.g. file_header_template = YourCopy righted Info Here.










    Extra
  6. User String.asSpan[1..3] in C# 9






For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email Address[email protected]