Cross-Platform Modern Apps with VS Code: Combine the power of EF Core, ASP.NET Core and Xamarin.Forms to build multi-platform applications on Visual Studio Code
()
About this ebook
You will learn how to build native apps, spend less time working with the platform, and focus more on the creative aspects of generating a smart UI. While you learn and practise on VS Code, you build solid grounds on robust server-side programming. You will learn how to use VS Code to develop your javascript, typescript, nodejs, or angular app more quickly and easily. Not only an application development environment, but VS Code also enables you to create microservices, extensions, and cloud applications. Not only can you construct applications with VS Code, but you can also develop microservices, extensions, and cloud applications. Throughout the book, you get trained on Entity Framework Core, Razor, Xamarin.Forms and numerous APIs.
This book not only prepares you to design multi-platform applications or work with Visual Studio Code, but it also prepares you to be a great developer who can alter the code, debug issues, and manage the many versions on your own.
Read more from Ockert J. Du Preez
Visual Studio 2022 In-Depth: Explore the Fantastic Features of Visual Studio 2022 - 2nd Edition Rating: 0 out of 5 stars0 ratingsJavaScript for Gurus: Use JavaScript programming features, techniques and modules to solve everyday problems Rating: 0 out of 5 stars0 ratings
Related to Cross-Platform Modern Apps with VS Code
Related ebooks
Enterprise Applications with C# and .NET: Develop robust, secure, and scalable applications using .NET and C# (English Edition) Rating: 0 out of 5 stars0 ratingsObject Oriented Programming with Angular: Build and Deploy Your Web Application Using Angular with Ease ( English Edition) Rating: 0 out of 5 stars0 ratingsDesigning Microservices using Django: Structuring, Deploying and Managing the Microservices Architecture with Django Rating: 0 out of 5 stars0 ratingsExploring Web Components: Build Reusable UI Web Components with Standard Technologies (English Edition) Rating: 0 out of 5 stars0 ratingsASP.NET Core for Jobseekers: Build Career in Designing Cross-Platform Web Applications Using Razor and Entity Framework Core Rating: 0 out of 5 stars0 ratingsMastering C# 8.0: Master C# Skills with Hands-on Code Examples (English Edition) Rating: 0 out of 5 stars0 ratingsJava 8 to 21: Explore and work with the cutting-edge features of Java 21 (English Edition) Rating: 0 out of 5 stars0 ratingsNode.js: Novice to Ninja Rating: 0 out of 5 stars0 ratingsTools and Skills for .NET 8: Get the career you want with good practices and patterns to design, debug, and test your solutions Rating: 0 out of 5 stars0 ratingsModern Web Development with Go: Build real-world, fast, efficient and scalable web server apps using Go programming language Rating: 0 out of 5 stars0 ratingsBootstrap for ASP.NET MVC - Second Edition Rating: 5 out of 5 stars5/5Mastering MEAN Stack: Build full stack applications using MongoDB, Express.js, Angular, and Node.js (English Edition) Rating: 0 out of 5 stars0 ratingsBuilding Server-side and Microservices with Go: Building Modern Backends and Microservices Using Go, Docker and Kubernetes Rating: 0 out of 5 stars0 ratingsVisual Studio Code: End-to-End Editing and Debugging Tools for Web Developers Rating: 0 out of 5 stars0 ratingsBuilding a Web App with Blazor and ASP .Net Core: Create a Single Page App with Blazor Server and Entity Framework Core Rating: 0 out of 5 stars0 ratingsReactive State for Angular with NgRx: Learn to build Reactive Angular Applications using NgRx (English Edition) Rating: 0 out of 5 stars0 ratingsReact.js Design Patterns: Learn how to build scalable React apps with ease (English Edition) Rating: 0 out of 5 stars0 ratingsProfessional C# and .NET Rating: 0 out of 5 stars0 ratingsJava Spring Framework: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsDocker: Up and Running: Build and deploy containerized web apps with Docker and Kubernetes (English Edition) Rating: 0 out of 5 stars0 ratingsMastering Go: Navigating the World of Concurrent Programming Rating: 0 out of 5 stars0 ratings
Computers For You
The Invisible Rainbow: A History of Electricity and Life Rating: 5 out of 5 stars5/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Elon Musk Rating: 4 out of 5 stars4/5The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5Standard Deviations: Flawed Assumptions, Tortured Data, and Other Ways to Lie with Statistics Rating: 4 out of 5 stars4/5How to Create Cpn Numbers the Right way: A Step by Step Guide to Creating cpn Numbers Legally Rating: 4 out of 5 stars4/5Uncanny Valley: A Memoir Rating: 4 out of 5 stars4/5Alan Turing: The Enigma: The Book That Inspired the Film The Imitation Game - Updated Edition Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsEverybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5Slenderman: Online Obsession, Mental Illness, and the Violent Crime of Two Midwestern Girls Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5101 Awesome Builds: Minecraft® Secrets from the World's Greatest Crafters Rating: 4 out of 5 stars4/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 5 out of 5 stars5/5The Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5ChatGPT 4 $10,000 per Month #1 Beginners Guide to Make Money Online Generated by Artificial Intelligence Rating: 0 out of 5 stars0 ratingsLearning the Chess Openings Rating: 5 out of 5 stars5/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsTor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5
Reviews for Cross-Platform Modern Apps with VS Code
0 ratings0 reviews
Book preview
Cross-Platform Modern Apps with VS Code - Ockert J. du Preez
Section - I
Introductory Concepts
Introduction
Section I introduces you to Visual Studio Code. Chapter 1, Comparing Visual Studio Code to Visual Studio, highlights Visual Studio Code’s origin story and the need for Visual Studio Code. In Chapter 2, Up and Running with VS Code, you will learn how to set up Visual Studio Code and start programming with it. This is exciting stuff; so, let us get started!
In this section, we have the following chapters:
Chapter 1, Comparing Visual Studio Code to Visual Studio
Chapter 2, Up and running with VS Code
CHAPTER 1
Comparing Visual Studio Code to Visual Studio
This chapter focuses on the origins of Visual Studio Code. It provides a brief history of the product, and a brief introduction to its features. Most importantly, it answers the question, why Visual Studio Code, and why do we need it?
Structure
In this chapter, we will cover the following topics:
Differences between Visual Studio and Visual Studio Code
History of Visual Studio Code
Reasons to choose Visual Studio Code
Visual Studio Code adaptation
Visual Studio Code use cases
Objectives
After studying this chapter, you will know the basic difference between VS code and Visual Studio (VS). You can explore everything that can be done with Visual Studio Code and learn why it is the best tool to use for the cross-platform apps.
Differences between Visual Studio and Visual Studio Code
You may think that using this as a starting topic is a bit strange, but it is not. The reason for this is that many developers confuse Visual Studio Code with Visual Studio. So, the quicker we get the differences out of the way, the faster we can start exploring the ins-and-outs of Visual Studio Code.
Visual Studio
Visual Studio (VS) is Microsoft’s flagship Integrated Development Environment (IDE) for developing, debugging, and deploying the desktop, web, and mobile applications. Visual Studio consists of a huge range of features that are required for easy application development such as auto complete, server setup, database integrations, and source control.
The first version of Visual Studio was released in 1997, and it was the first time that all the Microsoft’s programming tools were integrated into one common IDE. Now, more than 20 years later, the technology landscape has changed tremendously, and Visual Studio has adapted continuously with it. Therefore, Visual Studio 2019, the latest version, includes the best and newest tools to work with the modern-day problems and technologies properly.
Visual Studio 2019 comes in various editions, which are as follows:
Visual Studio 2019 Preview
Visual Studio Community
Visual Studio Professional
Visual Studio Enterprise
As the book focuses on VS Code, there won’t be many details covered regarding VS. But the editions of VS will be explained to demonstrate the differences between VS and VS Code.
The next few sections pertaining to Visual Studio 2019 cannot be covered in just one chapter. Therefore, a link is provided for more information on Visual Studio 2019 in the References section; it is a book dedicated solely to Visual Studio 2019.
Visual Studio 2019 Preview
Visual Studio 2019 contained three previews, each containing its own new changes. Preview 2 contained the fixes for Preview 1 and also some new features. Preview 3 contained the fixes for Preview 2 and some new features. It is seen as the final edition before the actual product launch.
Visual Studio 2019 Community
The Community Edition of Visual Studio 2019 is free. However, it does not have all the features that the Professional and Enterprise Editions have. Visual Studio Community 2019 is a fully featured IDE that can be used for creating applications for Android, iOS, Windows, plus web applications, and cloud services.
Visual Studio 2019 Professional
Visual Studio 2019 Professional includes the professional developer tools and services for the individuals or small teams. The Professional Edition includes everything that a professional developer needs to build the desktop applications, the web applications, as well as the mobile applications.
Visual Studio 2019 Enterprise
Visual Studio 2019 Enterprise is an integrated solution for teams of any size with demanding scale and quality needs. It includes all the features that Visual Studio has to offer. We can take advantage of all the debugging and testing tools such as coded UI testing, Xamarin inspector, code coverage, and live unit testing.
Visual Studio Code
Visual Studio Code is a free and streamlined open-source text editor. It has IntelliSense, a much smaller download size, and smaller RAM requirements. It works on lower end PCs and is more suited for tasks that are project specific.
Visual Studio Code is very well suited for the Windows, Linux, and macOS developers utilizing the client-side web technologies such as HTML, JavaScript, and CSS.
The upcoming sections will concentrate solely on Visual Studio Code; so, let us start with its history.
History of Visual Studio Code
It is amazing to think that Visual Studio Code was developed by four people. The team leader, Erich Gamma joined Microsoft in 2011 as a distinguished engineer in Zurich. Gamma was an IBM engineer who worked on the IBM Rational Jazz project and was one of the fathers of the Eclipse Java development editor project.
Together with Kent Beck, the creator of extreme programming (a software development methodology that improves software quality and responsiveness to the changing customer requirements), he co-wrote the JUnit software testing framework, thus creating the test-driven development which influenced the whole software industry.
Visual Studio Online (code named: Monaco) was released in 2013. Not many users adopted it (roughly between 3000 and 5000 users), so it was decided to switch Visual Studio Code to a Desktop app, leveraging the web technology they had. This happened in November 2014, only six months before the Beta launch of Visual Studio Code. This was also around the time when the node replicate became available, which allows you to run a JavaScript application with node APIs as a desktop electron application. Electron is a framework for creating the native applications with web technologies such as JavaScript, HTML, and CSS.
At the 2015 Build conference on April 29, 2015, Microsoft first announced Visual Studio Code by Microsoft. The beta version of Visual Studio Code focused on the differences between Visual Studio Code and the other competing editors at that point in time, such as Sublime Text and Atom.
The beta version also included rich language support for languages such as TypeScript and C#, as well as the great IntelliSense support.
A Preview build was released shortly thereafter. Visual Studio Code was released under the MIT permissive license (free-software license with minimal restrictions on how the software can be used, modified, and redistributed) on November 18, 2015. Visual Studio Code was released on the web on April 14, 2016, after graduating from the public preview stage.
The extension support was also announced, and its source code was made available on the microsoft/vscode (code - OSS) repository of GitHub. A link to this is provided in the References section at the end of this chapter.
Reasons to choose Visual Studio Code
Visual Studio Code is becoming increasingly popular, and we cannot help but wonder why? Let us explore some reasons.
Visual Studio Code is open-source
As mentioned earlier, since Visual Studio Code is open source, it is free to use. An added bonus is that you can also help improve it by contributing the code to its source code on GitHub microsoft/vscode. The link is provided in the References section at the end of this chapter. Another benefit of being open source is that it increases community engagement, and even if it doesn’t, everyone contributes to the Visual Studio Code's code base, which still gives them a sense of unity.
Minimal design
The default user interface of Visual Studio Code is clean and well-designed. If, however, you do not like the default design, you can create and use your own customized themes which are very flexible in customizing nearly all the UI elements of the editor. If you do not want to create your own re-usable themes, you can choose a theme from the thousands that are available on the market.
Simplicity
From downloading and installing Visual Studio Code to using it, it is very simple and easy. Unlike Visual Studio, there are not a plethora of options and workloads to install.
Extensibility
Visual Studio Code is very extensible, and you can install the extensions for almost all the popular programming languages. This means that you do not have to download bloated or convoluted IDEs such as Visual Studio.
It supports hundreds of programming languages. Visual Studio Code supports a myriad of programming languages, including Python, JavaScript, HTML, CSS, TypeScript, C++, Java, PHP, Go, C#, PHP, SQL, Ruby, Objective-C, and much more.
Visual Studio Code adaptation
In February 2021, Visual Studio Code had a user base of over fourteen million. In 2020 alone, the number of Visual Studio Code users grew by a whopping five million due to the need for remote development during the COVID-19 pandemic. By June 2020, Visual Studio Code had eleven million users.
According to Julia Liuson, the corporate vice president of Microsoft's developer division, Visual Studio Code had almost two million Python developers, over a million C++ developers, and almost one million Java developers as of February 2021.
The major reasons for Visual Studio Code’s popularity are as follows:
It can run on macOS, Windows 10, and various distributions of Linux. Visual Studio Code supports Arm64 on Linux and runs on Raspberry Pi and Chromebooks. Visual Studio Code is also available for the insider builds of Visual Studio Code on Apple's arm-based M1 chips.
The breadth of the language extensions are C++, C#, Python (including Python libraries for data scientists) Java, and JavaScript/Typescript.
The Visual Code Live Share feature, launched in 2017, has gotten tons of adoption, mainly due to the Work from Home (WFH) practices caused by the COVID-19 pandemic.
Visual Studio Code use cases
A use case is a scenario for a piece of software where it may be useful. We will cover three different use case scenarios, which are as follows:
Coding use cases
Non-coding use cases
Collaboration use cases
Let us see what they are about.
Coding use cases
There are various use cases when coding with a team is involved. Let us look at these major use cases in the following section.
Remote development
One of the major use cases that allow you to develop the apps remotely is remote development. Remote development allows you to develop the apps remotely. The Visual Studio Code Remote Development Extension Pack enables a developer to open any folder in an Azure Docker container on a remote machine or in the Windows subsystem for Linux and takes advantage of the Visual Studio Code's full feature set.
This extension pack lets you set up a full-time development environment anywhere that enables you to do the following:
Develop on the same operating system you deploy to.
Use more specialized hardware than your local machine.
Swap between different developments environments.
Make updates without impacting your local machine.
Help new team members with consistent development containers.
Use the Linux based tool chain from Windows.
No source code needs to be on your local machine.
The Visual Studio Code Remote Development Extension Pack includes the following three extensions:
Remote SSH
Remote containers
Remote WSL
Remote SSH
The developers can work with the source code in any location by opening the folders on a remote machine or virtual machine using SSH. This means that no source code needs to be on the developer's local machine to take advantage of the Visual Studio Code's feature set, since this extension runs all its commands and extensions directly on the remote machine.
Remote containers
The developers can work with a sandboxed tool chain or Docker container-based application with the help of a devcontainer.json file, telling Visual Studio Code how to access (or create) a development container.
Remote WSL
It gives the developers a Linux-powered development experience from Windows. One has to remember that the Windows subsystem for Linux is an optional feature on Windows 10. It should be enabled through the Windows features dialog or PowerShell. To enable WSL on Windows 10, complete the following steps:
In the Windows search bar, type features. This brings up the Turn Windows features on and off dialog, as shown in Figure 1.1:
Figure 1.1: Turn Windows features on and off dialog
Scroll down to find the Windows subsystem for Linux and check it; this should also look like the window in Figure 1.1.
Restart Windows.
Open Windows’ search again, and type in Linux distro. Here, choose which one to install.
Let us now have a look at some of the non-coding use cases in Visual Studio Code.
Non-coding use cases
Apart from using Visual Studio Code for coding in any of its many supported languages, you can also complete the following non-coding-oriented