-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development - Fourth Edition
By :
This section is all about how to find quality information about programming on the web.
The definitive resource for getting help with Microsoft developer tools and platforms used to be Microsoft Developer Network (MSDN). Now, it is Microsoft Docs, and you can find it at the following link: https://docs.microsoft.com/.
At the command line, you can ask the dotnet tool for help about its commands.
dotnet new command, enter the following at the command line or in Visual Studio Code Terminal:dotnet help new
-h or --help flag, as shown in the following command:dotnet new console -h
Console Application (C#)
Author: Microsoft
Description: A project for creating a command-line application that can run on .NET Core on Windows, Linux and macOS
Options:
--langVersion Sets langVersion in the created project file
text - Optional
--no-restore If specified, skips the automatic restore of the project on create.
bool - Optional
Default: false / (*) true
* Indicates the value used if the switch is provided without a value.One of the most useful keyboard shortcuts in Visual Studio Code is F12 to Go To Definition. This will show what the public definition of the type or member looks like by reading the metadata in the compiled assembly. Some tools like ILSpy .NET Decompiler will even reverse-engineer from the metadata and IL code back into C# for you.
HelloCS folder.Program.cs, inside the Main method, enter the following statement to declare an integer variable named z:int z;
int and then press F12, or right-click and choose Go To Definition. In the new code window that appears, you can see how the int data type is defined, as shown in the following screenshot:

You can see that int:
struct keyword.System.Runtime assembly.System namespace.Int32.System.Int32 type.IComparable.Parse.Good Practice: When you try to use Go To Definition you will sometimes see an error saying, No definition found. This is because the C# extension does not know about the current project. Navigate to View | Command Palette, enter and select OmniSharp: Select Project, and then select the correct project that you want to work with.
Right now, the Go To Definition feature is not that useful to you because you do not yet know what these terms mean.
By the end of the first part of this book, which teaches you about C#, you will know enough for this feature to become very handy.
Parse method with a single string parameter starting on line 86, as shown in the following screenshot:

In the comment, you will see that Microsoft has documented what exceptions might occur if you call this method, including ArgumentNullException, FormatException, and OverflowException. Now, we know that we need to wrap a call to this method in a try statement and which exceptions to catch.
Hopefully, you are getting impatient to learn what all this means!
Be patient for a little longer. You are almost at the end of this chapter, and in the next chapter you will dive into the details of the C# language. But first, let's see where else you can look for help.
Stack Overflow is the most popular third-party website for getting answers to difficult programming questions. It's so popular that search engines such as DuckDuckGo have a special way to write a query to search the site.
!so securestring

You can search Google with advanced search options to increase the likelihood of finding what you need.
garbage collection using a simple Google query, and note that you will probably see a Wikipedia definition of garbage collection in computer science, and then a list of garbage collection services in your local area, as shown in the following screenshot:

garbage collection site:stackoverflow.com +C# -Java
To keep up to date with .NET, an excellent blog to subscribe to is the official .NET Blog written by the .NET engineering teams, and you can find it at the following link: https://blogs.msdn.microsoft.com/dotnet/
Change the font size
Change margin width
Change background colour