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.1 and .NET Core 2.0 ??? Modern Cross-Platform Development

You're reading from   C# 7.1 and .NET Core 2.0 ??? Modern Cross-Platform Development Create powerful applications with .NET Standard 2.0, ASP.NET Core 2.0, and Entity Framework Core 2.0, using Visual Studio 2017 or Visual Studio Code

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher
ISBN-13 9781788398077
Length 800 pages
Edition 3rd 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 (24) Chapters Close

Preface 1. Hello, C#! Welcome, .NET Core! FREE CHAPTER 2. Part 1, C# 7.1
3. Speaking C# 4. Controlling the Flow and Converting Types 5. Writing, Debugging, and Testing Functions 6. Building Your Own Types with Object-Oriented Programming 7. Implementing Interfaces and Inheriting Classes 8. Part 2 – .NET Core 2.0 and .NET Standard 2.0
9. Understanding and Packaging .NET Standard Types 10. Using Common .NET Standard Types 11. Working with Files, Streams, and Serialization 12. Protecting Your Data and Applications 13. Working with Databases Using Entity Framework Core 14. Querying and Manipulating Data Using LINQ 15. Improving Performance and Scalability Using Multitasking 16. Part 3 – App Models
17. Building Web Sites Using ASP.NET Core Razor Pages 18. Building Web Sites Using ASP.NET Core MVC 19. Building Web Services and Applications Using ASP.NET Core 20. Building Windows Apps Using XAML and Fluent Design 21. Building Mobile Apps Using XAML and Xamarin.Forms 22. Summary 23. Answers to the Test Your Knowledge Questions

Logging during development and runtime


Once you believe that all the bugs have been removed from your code, you would then compile a release version and deploy the application so people can use it. But no code is bug free, and during runtime unexpected errors can occur.

End users are notoriously bad about noticing what they were doing when an error occurs, so you should not rely on them accurately providing useful information to fix the problem.

Therefore, it is good practice to add code throughout your application to log what is happening, and especially when exceptions occur, so that you can review the logs and use them to trace the issue and fix the problem.

There are two types that can be used to add simple logging to your code: Debug and Trace. Debug is used to add logging that gets written during development. Trace is used to add logging that gets written during both development and runtime.

Instrumenting with Debug and Trace

You have seen the use of the Console type and its WriteLine method...

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 €18.99/month. Cancel anytime