Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning C# 7 Hands-On ?????? The Core Language

You're reading from   Beginning C# 7 Hands-On ?????? The Core Language Learn the C# language by coding it element by element

Arrow left icon
Product type Paperback
Published in Aug 2017
Publisher
ISBN-13 9781788296540
Length 566 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Tom Owsiak Tom Owsiak
Author Profile Icon Tom Owsiak
Tom Owsiak
Arrow right icon
View More author details
Toc

Table of Contents (60) Chapters Close

Preface 1. Why C# and How to Download and Install the Visual Studio Community Edition 2. Customizing Visual Studio to Make it Feel More Personal FREE CHAPTER 3. Creating and Running Your First Page 4. Creating and Running a Page That Incorporates C# 5. Creating and Using a Single Variable 6. String Interpolation and Updating Visual Studio 7. Formatting Output Strings for More Professional Results 8. Using Variables and Data Types 9. Computed Variables and Basic Math 10. Interacting with Users Through the Web Page 11. Using Method Chaining to Write More Compact Code 12. Reacting to a Single Condition with If/Else Blocks 13. Making a Variable Grow by Adding 1 14. Repeating Blocks of Code with While Loops 15. Repeating Blocks of Code with For Loops 16. Iterating Over Collections with foreach Loops 17. Examining Multiple Variable Values with Switch Blocks 18. Improving Input Processing with TryParse 19. Replacing If/Else Blocks with the Ternary Operator 20. Operators That Evaluate and Assign in Place 21. Checking Two Conditions with the Logical AND Operator 22. Checking Two Conditions with the Logical OR Operator 23. Declaring, Setting, and Reading Arrays 24. Iterating Over Arrays with foreach Loops 25. Creating and Using a Simple Method 26. Passing Arrays into Methods 27. Reference Type and Value Type Variables 28. Creating More Flexible Methods with the params Keyword 29. Creating More Flexible Functions with the out Keyword 30. Combining the ref and out Keywords to Write Flexible Functions 31. The out Keyword in C# 7 32. Multidimensional Arrays 33. Writing Easier Code with the Var and Dynamic Keywords 34. Creating a Class with a Constructor and a Function 35. Creating a Class with a Static Method 36. Creating a Class with an Object Property 37. Creating a Class with Static Fields, and Properties 38. Centralizing Common Code with Inheritance 39. Centralizing Default Code with Virtual Functions 40. Model Concepts with Abstract Classes 41. Using Custom Types as Return Types 42. Using Lists to Operate on Data Efficiently 43. Writing Less Code with Polymorphism 44. Using Interfaces to Express Common Behaviors 45. Iterating over Instances with Indexers 46. Building Stabler Apps with Exception Handling 47. Using Named and Optional Parameters 48. Using the Null Coalescing Operator to Write Stabler Applications 49. Overloading Operators to Perform Custom Operations 50. Using Enumerations to Represent Named Constants 51. Creating and Using Namespaces 52. Structs, Random Points, and Sleeping Threads 53. Declaring, Creating, and Using Delegates 54. Switch Blocks with when in C# 7.0 55. Switch Blocks with Objects in C# 7.0 56. Tuples in C# 7.0 57. Local functions in C# 7.0 58. Throwing Exceptions in C# 7.0 59. Tuples in C# 7.0, Part 2

Locating and downloading the Visual Studio Community edition

In this chapter, we're going to take a look at how to get Visual Studio 2017. You can either go directly to www.visualstudio.com/downloads or just do a search for Visual Studio 2017 download. This should bring you to a page similar to this one:

Figure 2.1:

Keep in mind that these pages are updated regularly. In the preceding screenshot, you will see that there are several versions. The one that interests us, of course, is Visual Studio Community 2017, the free version.

Click on Free download. This should automatically download a small installer. Depending on how your system is set up, it will either download it directly to the Downloads folder, or prompt you for where you want to save it. I've created a VS_Community folder inside My Downloads folder and saved it there. Of course, you can save it wherever you want to. Once this is done--it won't take long as it's just a small file--locate the downloaded VS_Community.EXE file and open it up.

Once you open it, you should see this screen.

Figure 2.2: The License screen

Click on Continue, which should take you through to the next screen:

Figure 2.3: Choosing download components

From here, you can select the set of features you want to install on your system. For our purposes, I've chosen.NET desktop development at the top. If you click on it, you should see a check mark appear in the top corner to show that it's been selected:

Figure 2.4: Selecting .NET desktop development

Down at the bottom of the window, there's a location bar. If you click on the three little dots, you can select where you want the Visual Studio program to be installed on your system. On the right-hand side, you have a summary field:

Figure 2.5: Selecting the following frameworks

This tells you what's going to be installed; also, down at the bottom, it says Total install size, 3.06 GB, so that's how much minimum free space you need wherever you're going to install this. Then, of course, click on the Install button in the lower right-hand corner. This should bring you to a page similar to this one:

Figure 2.6: Installation in progress

Now, it's just a matter of waiting for everything to be downloaded and then applied to your system. One thing that I recommend you do at this point is temporarily disable your antivirus software while this is being installed because it could interfere with the installation process. I got to about 90 percent and my system hung when I installed it. I went back and disabled my anti-virus software and it installed fine. You may have to do the same.

Once it's downloaded and installed, you should see a screen similar to this one:

Figure 2.7: The Welcome screen

From here on, of course, you can either look at the release notes if you want, or just click on the Launch button. Go ahead and click on the Launch button. This should bring you to a screen similar to this one:

Figure 2.8: The Sign in screen

If you want, you can sign in with your Microsoft account,if you remember. I chose Not now, maybe later. The next step is to choose the interface:

Figure 2.9: Choose color theme

I like the standard Blue one. Of course, you can use the Dark one or the Light one, whichever one you like, and then click on Start Visual Studio. Once it's loaded, it should look very similar to the one that you see right here:

Figure 2.10: Getting Started

Now Go to Help > About Microsoft Visual Studio; you'll see the version that you have installed. Mine is 15.3.0, which is the latest version at the time of this writing. Make sure that yours is the same or above (it should be, as you just downloaded the latest version from Microsoft); otherwise, the code samples that we create will not work because they rely on the features of C# available in this version. Okay, close the About box. That's it! You're now ready to start learning C# 7.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime