Chapter 8. Creating Bootstrap 4 ASP.NET MVC Sites Using Visual Studio Code

During their Build 2015 conference, Microsoft unveiled a new lightweight code editor for writing web and mobile apps called Visual Studio Code. This was a major step for Microsoft, since it marked the first time they offered developers a cross-platform code editor that works on Windows, OS X, and Linux.

With the significant redesign of ASP.NET, which made it an open source and cross-platform framework, developers are now able to create ASP.NET websites on Windows, Linux, and OS X. Visual Studio Code makes this a little bit easier.

In this chapter, we will cover the following topics:

  • What is Visual Studio Code?
  • Installing Visual Studio Code
  • Scaffolding an empty ASP.NET project using Yeoman
  • Adding the Bootstrap 4 files using Bower
  • Compiling the Bootstrap Sass files using Gulp
  • Creating a layout file that references the Bootstrap files

What is Visual Studio Code?

Visual Studio Code, in essence, is an open source, cross-platform text editor. It is based on the Electron framework, formerly known as Atom Shell, which is a framework that enables you to write cross-platform desktop applications using HTML, CSS, and JavaScript. If you've ever used the Atom text editor by GitHub, you'll see a strong resemblance between that and Visual Studio Code.

Note

Atom is a hackable/customizable text editor from GitHub. It is also open source and can be downloaded from https://atom.io/.

Visual Studio Code can be used by developers to build web applications in HTML, CSS, and JavaScript, and also supports TypeScript and ASP.NET Core. It is folder-based rather than project-based, which means you simply need to open a folder containing your project files instead of opening a project file such as .csproj.

It features IntelliSense (which will be familiar to anyone that has used Visual Studio in the past) and also supports debugging and Git Source control features. It also includes a few features that Visual Studio developers have come to appreciate, such as syntax highlighting, auto indent, and bracket matching. Visual Studio Code is customizable in the sense that users can change the theme, preferences, and keyboard shortcuts. With the latest release, it also supports extensions, and there are already a wide range of extensions and themes available on https://marketplace.visualstudio.com/VSCode.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.156.251