Roslyn Cookbook
Compiler as a Service, Static Code Analysis, Code Quality, Code Generation, and more
Manish Vasani
BIRMINGHAM - MUMBAI
< html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
Roslyn Cookbook
Copyright 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2017
Production reference: 1260717
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78728-683-2
www.packtpub.com
Credits
Author Manish Vasani | Copy Editor Charlotte Carneiro |
Reviewers Ovais Mehboob Ahmed Khan | Project Coordinator Sheejal Shah |
Commissioning Editor Aaron Lazar | Proofreader Safis Editing |
Acquisition Editor Nitin Dasan | Indexer Rekha Nair |
Content Development Editor Jason Pereira | Graphics Jason Monteiro |
Technical Editor Prashant Mishra | Production Coordinator Melwyn Dsa |
About the Author
Manish Vasani is a senior software developer working for Microsoft Corporation based in Redmond, WA, USA. He is extremely passionate about working on extensible compiler platforms designed to enable rich analysis scenarios. He did his master's in Computer Science at Columbia University, New York, with a focus on compiler design under the guidance of Professor Alfred V. Aho.
He has roughly 10+ years of work experience at Microsoft, and has been on the Roslyn Managed Languages team since mid-2011. During this time, he has worked on the Roslyn compiler and IDE teams, as well as on the new Roslyn project system for .Net Core projects.
He is currently working on the Roslyn analyzers team and was part of the design team for the analyzer and code fix API and implemented the analyzer driver that executes the analyzers in the compiler and VS IDE. They are also working towards porting FxCop code analysis rules to FxCop analyzers.
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.
About the Reviewer
Ovais Mehboob Ahmed Khan is a seasoned programmer and solution architect with more than 14 years of software development experience. He has worked in different organizations across Pakistan, the USA, and the Middle East. Currently, he is working for a government entity based in Dubai, and also provides consultancy services to a Microsoft gold partner firm based in New Jersey.
He is a Microsoft MVP in Visual Studio and Development Technologies and specializes mainly in Microsoft .NET, cloud, and web development. He is a prolific writer and has published numerous technical articles on different websites, such as MSDN, TechNet, and DZone; he also has a personal blog at (http://OvaisMehboob.com) and is the author of two books, titled as JavaScript for .NET Developers and Enterprise Application Architecture with .NET Core, published by Packt. He is an active speaker and group leader of Microsoft Developers UAE Meetup, Microsoft Technology Practices, and Developers and Enterprise Practices user groups, and has presented various technical sessions at various events and conferences.
In short, Ovais is a passionate developer and an architect, who is always interested in learning new technologies. He can be reached at ovaismehboob@hotmail.com, and on Twitter at @ovaismehboob.
Next page