Search icon CANCEL
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
C# 7 and .NET Core: Modern Cross-Platform Development

You're reading from   C# 7 and .NET Core: Modern Cross-Platform Development Create powerful cross-platform applications using C# 7, .NET Core, and Visual Studio 2017 or Visual Studio Code

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher
ISBN-13 9781787129559
Length 594 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Mark J. Price Mark J. Price
Author Profile Icon Mark J. Price
Mark J. Price
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Hello, C#! Welcome, .NET Core! FREE CHAPTER 2. Speaking C# 3. Controlling the Flow, Converting Types, and Handling Exceptions 4. Using .NET Standard Types 5. Debugging, Monitoring, and Testing 6. Building Your Own Types with Object-Oriented Programming 7. Implementing Interfaces and Inheriting Classes 8. Working with Databases Using the Entity Framework Core 9. Querying and Manipulating Data with LINQ 10. Working with Files, Streams, and Serialization 11. Protecting Your Data 12. Improving Performance and Scalability with Multitasking 13. Building Universal Windows Platform Apps Using XAML 14. Building Web Applications Using ASP.NET Core MVC 15. Building Mobile Apps Using Xamarin.Forms and ASP.NET Core Web API 16. Packaging and Deploying Your Code Cross-Platform A. Answers to the Test Your Knowledge Questions

Managing source code with GitHub

Git is a commonly used source code management system. GitHub is a company, website, and desktop application that makes it easier to manage Git.

I used GitHub to store solutions to all the practical exercises at the end of each chapter at the following URL:

https://github.com/markjprice/cs7dotnetcore.

Using Git with Visual Studio 2017

Visual Studio 2017 has built-in support for using Git with GitHub as well as Microsoft's own source code management system named Visual Studio Team Services.

Using the Team Explorer window

In Visual Studio 2017, navigate to View | Team Explorer to see the Team Explorer window:

Using the Team Explorer window

Although it is a good idea to sign up with an online source code management system provider, you can clone a GitHub repository without signing up for an account.

Cloning a GitHub repository

In the Team Explorer window, expand Local Git Repositories, click on the Clone menu, and then enter the following URL of a Git repository to clone it: https://github.com/markjprice/cs7dotnetcore.git.

Enter a path for the cloned Git repository:

C:\Code\Repos\cs7dotnetcore

Click on the Clone button.

Wait for the Git repository to clone locally.

You will now have a local copy of the complete solutions to all the hands-on practice exercises for this book.

Managing a GitHub repository

Double-click on the cs7dotnetcore repo to open a detail view.

You can click on the options in the Project section to view Pull Requests and Issues and other aspects of a repository.

You can double-click on an entry in the Solutions section to open it in the Solution Explorer.

Using Git with Visual Studio Code

Visual Studio Code has support for Git, but it will use your OS's Git installation, so you must install Git 2.0 or later first before you get these features. You can install Git from here: https://git-scm.com/download.

Note

If you like to use a graphical user interface, you can download GitHub Desktop here: https://desktop.github.com.

Configuring Git at the command line

Launch Terminal, and enter the following command to check your configuration:

git config --list

The output should include your username and e-mail address, because these will be used with every commit that you make:

...other congfiguration...
user.name=Mark J. Price
user.email=markjprice@gmail.com

If your user name and e-mail has not been set, to set your user name and email, enter the following commands, using your own name and e-mail, not mine:

git config --global user.name "Mark J. Price"
git config --global user.email markjprice@gmail.com

You can check an individual configuration setting like this:

git config user.name

Managing Git with Visual Studio Code

Launch Visual Studio Code.

Navigate to View | Integrated Terminal or press Ctrl+ ` and enter the following commands:

cd Code
mkdir Repos
cd Repos
git clone https://github.com/markjprice/cs7dotnetcore.git

It will take a minute to clone all the solutions for all the chapters to your local drive, as shown in the following screenshot:

Managing Git with Visual Studio Code

It is best to open one project folder at a time because the cs7dotnetcore repository does not include any dependencies, so you will need to restore them using the dotnet restore command, or wait for Visual Studio Code to prompt you after opening a folder.

For more information about source code version control with Visual Studio Code, visit: https://code.visualstudio.com/Docs/editor/versioncontrol.

You have been reading a chapter from
C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition
Published in: Mar 2017
Publisher:
ISBN-13: 9781787129559
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 €18.99/month. Cancel anytime