Book Image

Roslyn Cookbook

Book Image

Roslyn Cookbook

Overview of this book

Open-sourcing the C# and Visual Basic compilers is one of the most appreciated things by the .NET community, especially as it exposes rich code analysis APIs to analyze and edit code. If you want to use Roslyn API to write powerful extensions and contribute to the C# developer tool chain, then this book is for you. Additionally, if you are just a .NET developer and want to use this rich Roslyn-based functionality in Visual Studio to improve the code quality and maintenance of your code base, then this book is also for you. This book is divided into the following broad modules: 1. Writing and consuming analyzers/fixers (Chapters 1 - 5): You will learn to write different categories of Roslyn analyzers and harness and configure analyzers in your C# projects to catch quality, security and performance issues. Moving ahead, you will learn how to improve code maintenance and readability by using code fixes and refactorings and also learn how to write them. 2. Using Roslyn-based agile development features (Chapters 6 and 7): You will learn how to improve developer productivity in Visual Studio by using features such as live unit testing, C# interactive and scripting. 3. Contributing to the C# language and compiler tool chain (Chapters 8 - 10): You will see the power of open-sourcing the Roslyn compiler via the simple steps this book provides; thus, you will contribute a completely new C# language feature and implement it in the Roslyn compiler codebase. Finally, you will write simple command line tools based on the Roslyn service API to analyze and edit C# code.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Dedication

Acknowledgments

First, I would like to thank my parents for all their unconditional love and support throughout all these years. They taught me to never give up on my dreams, no matter how difficult the circumstances. I would never be the person I am today without them being on my side all this time. I would like to thank my elder sister and my late elder brother for their love and care throughout our childhood. No matter however far apart we are, you all will always live in my heart.

I would also like to thank all my teachers, right from my elementary schooling up to my graduation. You showed me value of knowledge and the true way to live life, which is to learn and spread knowledge every single day.

I would like to thank all my friends, who have helped me gather and cherish all the beautiful and fun memories in life. I would especially like to thank Arjun Singri and Karthik Murthy, my college friends who first got me interested in compiler design. It is amazing how a small school project transformed into a lifelong passion and work, and has got me to this place where I can author a book on this topic.

I would like to thank my employers, Microsoft, and all my team members and leads till date. Microsoft is and will always be my second home. I cannot imagine working at any other place. I hope they can carry my burden for few more years and help me retire at this company.

I would like to thank Packtpub, for giving me the opportunity to write this book and publishing it. Thank you for believing in me and trusting that I am the right person to author this book.

Last, and by no means the least, I would like to thank my daughter, Inara, and my wife, Someeni. You both are the reason that I live every day, smile every day, enjoy every day.

Inara, you are the most beautiful miracle of my life. Being a father has given me more pride and joy, then anything else in life. Seeing you grow and take every step forward, gives me a reason to wait for the next day, so that I can see the pleasant surprises that you bring along with it. I will always remember the image of you clapping and jumping with joy "My daddy is writing a book, clap for daddyyyy...".

Someeni, you are my eternal pillar of support and strength. You have helped me through all the ups and downs of life. Stayed up late nights with me while I dabbled at the book. I had second thoughts about whether I can manage to write this book, but you never doubted it even once. You are the prettiest person I know, with the most beautiful heart and soul. I can never forget or repay the numerous sacrifices you have made as a wife and a mother. You have always unwaveringly chosen family over your own career and happiness. I am extremely grateful to have you as a life partner, I couldn't have asked for anyone better. I would like to dedicate this book to you and our journey together.