Professional C# 6 and .NET Core 1.0. Christian Nagel. Читать онлайн. Newlib. NEWLIB.NET

Автор: Christian Nagel
Издательство: John Wiley & Sons Limited
Серия:
Жанр произведения: Зарубежная образовательная литература
Год издания: 0
isbn: 9781119096634
Скачать книгу
application.

      For storing data in the cloud, you can use a relational data store SQL Database. SQL Database is nearly the same as the on-premise version of SQL Server. There are also some NoSQL solutions such as DocumentDB that stores JSON data, and Storage that stores blobs (for example, for images or videos) and tabular data (which is really fast and offers huge amounts of data).

      Web apps can be used to host your ASP.NET MVC solution, and API Apps can be used to host your ASP.NET Web API services.

      Visual Studio Online is part of the Developer Services offerings. Here you also can find Visual Studio Application Insights. With faster release cycles, it’s becoming more and more important to get information about how the user uses the app. What menus are never used because the users probably don’t find them? What paths in the app is the user is taking to fulfill his or her tasks? With Visual Studio Application Insights, you can get good anonymous user information to find out the issues users have with the application, and with DevOps in place you can do quick fixes.

      NOTE In Chapter 20, “Diagnostics and Application Insights,” you can read about tracing features and also how to use the Visual Studio Application Insights offering of Microsoft Azure. Chapter 45, “Deployment of Websites and Services,” not only shows deployment to the local Internet Information Server (IIS) but also describes deployment to Microsoft Azure Web Apps.

Developer Tools

      This final part of the chapter, before we switch to a lot of C# code in the next chapter, covers developer tools and editions of Visual Studio 2015.

      Visual Studio Community

      This edition of Visual Studio is a free edition with features that the Professional edition previously had. There’s a license restriction for when it can be used. It’s free for open-source projects and training, and also free to academic and small professional teams. Unlike the Express editions of Visual Studio that previously have been the free editions, this product allows using add-ins with Visual Studio.

      Visual Studio Professional with MSDN

      This edition includes more features than the Community edition, such as the CodeLens and Team Foundation Server for source code management and team collaboration. With this edition, you also get an MSDN subscription that includes several server products from Microsoft for development and testing.

      Visual Studio Enterprise with MSDN

      Visual Studio 2013 had Premium and Ultimate editions. Visual Studio 2015 instead has the Enterprise edition. This edition offers Ultimate features with a Premium price model. Like the Professional edition, this edition contains a lot of tools for testing, such as Web Load & Performance Testing, Unit Test Isolation with Microsoft Fakes, and Coded UI Testing. (Unit testing is part of all Visual Studio editions.) With Code Clone you can find code clones in your solution. Visual Studio Enterprise also contains architecture and modeling tools to analyze and validate the solution architecture.

      NOTE Be aware that with an MSDN subscription you’re entitled to free use of Microsoft Azure up to a specific monthly amount that is contingent on the type of the MSDN subscription you have.

      NOTE Chapter 17, “Visual Studio 2015,” includes details on using several features of Visual Studio 2015. Chapter 19, “Testing,” gets into details of unit testing, web testing, and creating Coded UI tests.

      NOTE For some of the features in the book – for example, the Coded UI Tests – you need Visual Studio Enterprise. You can work through most parts of the book with the Visual Studio Community edition.

      Visual Studio Code

      Visual Studio Code is a completely different development tool compared to the other Visual Studio editions. While Visual Studio 2015 offers project-based features with a rich set of templates and tools, Visual Studio is a code editor with little project management support. However, Visual Studio Code runs not only on Windows, but also on Linux and OS X.

      With many chapters of this book, you can use Visual Studio Code as your development editor. What you can’t do is create WPF, UWP, or WCF applications, and you also don’t have access to the features covered in Chapter 17, “Visual Studio 2015.” You can use Visual Studio Code for .NET Core console applications, and ASP.NET Core 1.0 web applications using .NET Core.

      You can download Visual Studio Code from http://code.visualstudio.com.

Summary

      This chapter covered a lot of ground to review important technologies and changes with technologies. Knowing about the history of some technologies helps you decide which technology should be used with new applications and what you should do with existing applications.

      You read about the differences between .NET Framework 4.6 and .NET Core 1.0, and you saw how to create and run a Hello, World application with all these environments without using Visual Studio.

      You’ve seen the functions of the Common Language Runtime (CLR) and looked at technologies for accessing the database and creating Windows apps. You also reviewed the advantages of ASP.NET Core 1.0.

      Chapter 2 steps into using Visual Studio to create the Hello, World application and goes on to discuss the syntax of C#.

      2

      Core C#

      What’s In This Chapter?

      • Creating Hello, World! with Visual Studio

      • Declaring variables

      • Initialization and scope of variables

      • Predefined C# data types

      • Dictating execution flow within a C# program

      • Enumerations

      • Namespaces

      • The Main method

      • Using internal comments and documentation features

      • Preprocessor directives

      • Guidelines and conventions for good programming in C#

      Wrox.com Code Downloads for This Chapter

      The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalcsharp6 on the Download Code tab. The code for this chapter is divided into the following major examples:

      • HelloWorldApp

      • VariablesSample

      • VariableScopeSample

      • IfStatement

      • ForLoop

      • EnumerationsSample

      • NamespacesSample

      • ArgumentsSample

      • StringSample

Fundamentals of C#

      Now that you understand more about what C# can do, you need to know how to use it. This chapter gives you a good start in that direction by providing a basic understanding of the fundamentals of C# programming, which is built on in subsequent chapters. By the end of this chapter, you will know enough C# to write simple programs (though without using inheritance or other object-oriented features, which are covered in later chapters).

Creating Hello, World! with Visual Studio

      Chapter 1, “.NET Application Architectures,” explains how to write a “Hello, World!” C# program using the csc Compiler for .NET 4.6 and using dotnet tools for .NET Core 1.0. You can also create it with Visual Studio 2015, which is done in this chapter.

      NOTE In the first chapters of this book, Visual Studio is used as a code editor and compiler without employing all the other features of Visual Studio. Chapter 17, “Visual Studio 2015,” covers more about all the other options and features offered by Visual Studio.

      Creating a Solution

      First,