Your ultimate guide

C# With NUnit _ Visual Studio Setup

About C#:

  • C# is an object-oriented language developed by Microsoft for developing software that runs on the .Net platform.
  • C# is the most popular and widely used for windows apps and Gaming.
  • C# is growing well beyond Microsoft domains and is used for the development of Android and iOS apps on the Xamarin platform.
  • Demand for C# is growing exponentially, and the future is bright for c#. Because it’s developed by Microsoft, the tech behemoth will likely make endless iterations and add useful features.


Download Visual Studio:

  1. Go to https://visualstudio.microsoft.com/downloads
  2. And Download Visual Studio Community Edition.
  3. Install it.
  4. In the installation Select below options:
  5. Select “.NET desktop development” and “Universal Windows Platform development” under Workloads
  6. Select “.NET 5.0 Runtime, and .NET Core 3.1 Runtime(LTS)” (select latest versions) under Individual components
  7. Then Click on install.


Lunching Visual studio First Time:

  • Choose the Visual studio theme: Choose a theme based on your wish.
  • Setup:
    1. Click on Create a new project.
    2. Select (C#) Console Application (Basic Project). And then click on Next
    3. Configure your new project:
      1. Project name: <Give your project name(Eg: CSharpFundamentals )>
      2. Location: <path of workshop>
      3. Solution name: (Solution is a container which holds multiple projects) <Give the solution name Eg: Testing Colleges>
      4. Then Click on Next.
    4. Addition information:
      1. Target Framework: <Select .NET latest version on dropdown>
      2. And then Click on Create.

 


More about C#:

  • Every C# program is saved with the .cs extension(CSharp).
  • In C# there is only one entry point(Main() method) in the project.
  • If you have multiple Main() method classes in a single project then we need to close all the entry points and make only one entry point for that:  
    •  then right-click on the Main() method class
    • if you want to/ don’t want to make as an entry > Click on Properties > Change Build action (Select "C# Compile"(to make as an entry point), None (To don’t want to execute)). 
    • If the build action of a class is None then the class not going to use any more, even if we can’t access the methods inside that class)

 

- Next Page: Basics-NuGet

No comments:

Post a Comment