Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Building CLI Applications with C# and .NET
  • Table Of Contents Toc
Building CLI Applications with C# and .NET

Building CLI Applications with C# and .NET

By : Tidjani Belmansour
5 (1)
close
close
Building CLI Applications with C# and .NET

Building CLI Applications with C# and .NET

5 (1)
By: Tidjani Belmansour

Overview of this book

Developers and system administrators often face challenges like inefficient workflows, complex system operations, and the growing demand for robust automation tools. CLI applications provide a powerful solution by enhancing flexibility, efficiency, and productivity in various environments. This book will guide you through mastering the development of robust command-line tools using .NET. Written by a Microsoft Azure MVP, the book’s hands-on approach ensures practical experience with real-world projects. You’ll start with an overview of foundational principles, essential concepts, and best practices for CLI application development. From there, you’ll advance to creating interactive interfaces, integrating with external APIs and services, and implementing security measures to safeguard your applications. Each chapter will build progressively from basic to advanced topics. Beyond development, you’ll learn how to enhance application quality through testing, package for efficient distribution, and deploy effectively. The book also teaches strategies to optimize performance to ensure your applications run efficiently under heavy usage. By the end of this book, you’ll have gained a deep understanding of CLI application development with .NET to build modular, extensible, and easy-to-maintain applications.
Table of Contents (23 chapters)
close
close
Lock Free Chapter
1
Part 1: Getting Started with CLI Applications
5
Part 2: Foundations of Building CLI Applications
9
Part 3: Advanced Topics in CLI Application Development
13
Part 4: Testing and Deployment
16
Part 5: Advanced Techniques and Best Practices

Implementing authentication

Here, we will leverage the PAT approach as it is more convenient and can work even in environments where no web browser can be launched, such as CI/CD pipelines.

To illustrate how this could be achieved, we will need to implement functionalities at two levels:

  • BookmarkrSyncr: The external service will receive the PAT, validate it, and authenticate the user if it is valid
  • Bookmarkr: The responsibility of the CLI application is to pass the token to the external service and act according to the response it gets from the sent request

Let’s start by adding the required functionality into BookmarkrSyncr.

Authenticating external services using a PAT

To make things simple, we will assume that BookmarkrSyncr (the code for which can be found in the AppendixB folder) holds two PAT tokens: a valid one and an expired one. All other values that the user passes will be considered invalid and will be rejected for this reason.

The token...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Building CLI Applications with C# and .NET
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon