100% found this document useful (2 votes)
19 views158 pages

Roslyn Succinctly 1st Edition Alessandro Del Sole PDF Version

The document is about the book 'Roslyn Succinctly' by Alessandro Del Sole, which provides an overview of the .NET Compiler Platform, also known as Project Roslyn. It discusses the book's goals, including introducing the platform, explaining its importance, and demonstrating its practical applications for developers. The book is available for free download from Syncfusion and is intended for developers with prior knowledge of .NET development.

Uploaded by

plwvzep3263
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
19 views158 pages

Roslyn Succinctly 1st Edition Alessandro Del Sole PDF Version

The document is about the book 'Roslyn Succinctly' by Alessandro Del Sole, which provides an overview of the .NET Compiler Platform, also known as Project Roslyn. It discusses the book's goals, including introducing the platform, explaining its importance, and demonstrating its practical applications for developers. The book is available for free download from Syncfusion and is intended for developers with prior knowledge of .NET development.

Uploaded by

plwvzep3263
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 158

Roslyn Succinctly 1st Edition Alessandro Del Sole

download

https://ebookultra.com/download/roslyn-succinctly-1st-edition-
alessandro-del-sole/

★★★★★
4.9 out of 5.0 (52 reviews )

Get PDF Instantly

ebookultra.com
Roslyn Succinctly 1st Edition Alessandro Del Sole

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Visual Studio 2019 Succinctly 1st Edition Alessandro Del


Sole

https://ebookultra.com/download/visual-studio-2019-succinctly-1st-
edition-alessandro-del-sole/

Visual Studio for Mac Succinctly 2018-12-20 Edition


Alessandro Del Sole

https://ebookultra.com/download/visual-studio-for-mac-
succinctly-2018-12-20-edition-alessandro-del-sole/

Svelte Succinctly 1st Edition Eduardo Freitas

https://ebookultra.com/download/svelte-succinctly-1st-edition-eduardo-
freitas/

Espanol A Literatura Libro del Alumno Programa del Diploma


del IB Oxford IB Diploma Program 1st Edition Bertone

https://ebookultra.com/download/espanol-a-literatura-libro-del-alumno-
programa-del-diploma-del-ib-oxford-ib-diploma-program-1st-edition-
bertone/
Camtasia Succinctly 1st Edition Jose Roberto Olivas
Mendoza

https://ebookultra.com/download/camtasia-succinctly-1st-edition-jose-
roberto-olivas-mendoza/

Gradle Succinctly 1st Edition Jose Roberto Olivas Mendoza

https://ebookultra.com/download/gradle-succinctly-1st-edition-jose-
roberto-olivas-mendoza/

Logic Colloquium 2004 1st Edition Alessandro Andretta

https://ebookultra.com/download/logic-colloquium-2004-1st-edition-
alessandro-andretta/

NW js Essentials 1st Edition Alessandro Benoit

https://ebookultra.com/download/nw-js-essentials-1st-edition-
alessandro-benoit/

Clinical Dentistry 1st Edition Giuseppe Alessandro


Scardina

https://ebookultra.com/download/clinical-dentistry-1st-edition-
giuseppe-alessandro-scardina/
By
Alessandro Del Sole

Foreword by Daniel Jebaraj

2
Copyright © 2016 by Syncfusion, Inc.
2501 Aerial Center Parkway
Suite 200
Morrisville, NC 27560
USA
All rights reserved.

I mportant licensing information. Please read.

This book is available for free download from www.syncfusion.com on completion of a registration form.

If you obtained this book from any other source, please register and download a free copy from
www.syncfusion.com.

This book is licensed for reading only if obtained from www.syncfusion.com.

This book is licensed strictly for personal or educational use.

Redistribution in any form is prohibited.

The authors and copyright holders provide absolutely no warranty for any information provided.

The authors and copyright holders shall not be liable for any claim, damages, or any other liability arising

from, out of, or in connection with the information in this book.

Please do not use this book if the listed terms are unacceptable.

Use shall constitute acceptance of the terms listed.

SYNCFUSION, SUCCINCTLY, DELIVER INNOVATION WITH EASE, ESSENTIAL, and .NET ESSENTIALS are the

registered trademarks of Syncfusion, Inc.

Technical Reviewer: James McCaffrey


Copy Editor: Courtney Wright
Acquisitions Coordinator: Hillary Bowling, online marketing manager, Syncfusion, Inc.
Proofreader: Graham High, content producer, Syncfusion, Inc.

3
Table of Contents

The Story behind the Succinctly Series of Books ................................................................................... 7

About the Author ......................................................................................................................................... 9

Introduction ............................................................................................................................................... 10

Chapter 1 Project Roslyn: The .NET Compiler Platform ...................................................................... 11

Introducing Project Roslyn ..................................................................................................................... 11

Cloning the Roslyn Repository to Your Computer ................................................................................. 12

Installing the .NET Compiler Platform SDK ........................................................................................... 15

What’s Next ............................................................................................................................................ 15

Chapter Summary .................................................................................................................................. 16

Chapter 2 Coding in Visual Studio 2015: A Roslyn-Powered Experience ......................................... 17

Live Static Code Analysis: Light Bulbs and Quick Actions .................................................................... 17

Code Refactoring ................................................................................................................................... 21

Behind the Scenes: Roslyn Analysis Explained Succinctly ................................................................... 23

Downloading, Installing, and Using Code Analyzers ............................................................................. 24

Chapter Summary .................................................................................................................................. 30

Chapter 3 Walking through Roslyn: Architecture, APIs, Syntax......................................................... 32

The Compiler Pipeline............................................................................................................................ 32

The .NET Compiler Platform’s Architecture ........................................................................................... 33

Assemblies and Namespaces ............................................................................................................... 34

The Concept of Immutability .................................................................................................................. 35

The Compiler APIs ................................................................................................................................. 35

The Workspaces APIs ........................................................................................................................... 36

4
Working with Syntax .............................................................................................................................. 37

Introducing Semantics ........................................................................................................................... 45

Chapter Summary .................................................................................................................................. 47

Chapter 4 Writing Code Analyzers ......................................................................................................... 48

Writing Code Analyzers ......................................................................................................................... 48

Adding Multiple Diagnostics to an Analyzer Library .............................................................................. 80

Chapter Summary .................................................................................................................................. 81

Chapter 5 Writing Refactorings .............................................................................................................. 82

Creating a Code Refactoring ................................................................................................................. 82

Structure of Code Refactorings ............................................................................................................. 83

Understanding Syntax Elements ........................................................................................................... 84

Implementing the Refactoring Logic ...................................................................................................... 85

Testing and Debugging a Code Refactoring.......................................................................................... 92

Chapter Summary .................................................................................................................................. 93

Chapter 6 Deploying Analyzers to NuGet .............................................................................................. 94

Quick Recap: About NuGet.................................................................................................................... 94

Preparing an Example ........................................................................................................................... 94

Preparing for Publication........................................................................................................................ 94

Publishing Analyzers to NuGet .............................................................................................................. 97

Tips and Tricks for Analyzers and Refactorings .................................................................................. 102

Chapter Summary ................................................................................................................................ 103

Chapter 7 Deploying Analyzers and Refactorings to the Visual Studio Gallery ............................. 104

Understanding VSIX Packages ........................................................................................................... 104

Preparing an Example ......................................................................................................................... 105

Preparing for Publication...................................................................................................................... 105

Publishing to the Visual Studio Gallery ................................................................................................ 108

Differences between NuGet and the Visual Studio Gallery ................................................................. 114

5
Chapter Summary ................................................................................................................................ 115

Chapter 8 Workspaces, Code Generation, Emit ................................................................................. 116

Getting Started with Workspaces ........................................................................................................ 116

Code Generation and Emit .................................................................................................................. 121

Chapter Summary ................................................................................................................................ 127

6
The Story behind the Succinctly Series
of Books
Daniel Jebaraj, Vice President
Syncfusion, Inc.
taying on the cutting edge

S As many of you may know, Syncfusion is a provider of software components for the
Microsoft platform. This puts us in the exciting but challenging position of always
being on the cutting edge.

Whenever platforms or tools are shipping out of Microsoft, which seems to be about
every other week these days, we have to educate ourselves, quickly.

Information is plentiful but harder to digest


In reality, this translates into a lot of book orders, blog searches, and Twitter scans.

While more information is becoming available on the Internet and more and more books are
being published, even on topics that are relatively new, one aspect that continues to inhibit us is
the inability to find concise technology overview books.

We are usually faced with two options: read several 500+ page books or scour the web for
relevant blog posts and other articles. Just as everyone else who has a job to do and customers
to serve, we find this quite frustrating.

The Succinctly series


This frustration translated into a deep desire to produce a series of concise technical books that
would be targeted at developers working on the Microsoft platform.

We firmly believe, given the background knowledge such developers have, that most topics can
be translated into books that are between 50 and 100 pages.

This is exactly what we resolved to accomplish with the Succinctly series. Isn’t everything
wonderful born out of a deep desire to change things for the better?

The best authors, the best content


Each author was carefully chosen from a pool of talented experts who shared our vision. The
book you now hold in your hands, and the others available in this series, are a result of the
authors’ tireless work. You will find original content that is guaranteed to get you up and running
in about the time it takes to drink a few cups of coffee.

Free forever
Syncfusion will be working to produce books on several topics. The books will always be free.
Any updates we publish will also be free.

7
Free? What is the catch?
There is no catch here. Syncfusion has a vested interest in this effort.

As a component vendor, our unique claim has always been that we offer deeper and broader
frameworks than anyone else on the market. Developer education greatly helps us market and
sell against competing vendors who promise to “enable AJAX support with one click,” or “turn
the moon to cheese!”

Let us know what you think


If you have any topics of interest, thoughts, or feedback, please feel free to send them to us at
[email protected].

We sincerely hope you enjoy reading this book and that it helps you better understand the topic
of study. Thank you for reading.

Please follow us on Twitter and “Like” us on Facebook to help us spread the


word about the Succinctly series!

8
About the Author

Alessandro Del Sole has been a Microsoft Most Valuable Professional (MVP) since 2008.
Awarded MVP of the Year in 2009, 2010, 2011, 2012, and 2014, he is internationally considered
a Visual Studio expert and a Visual Basic authority.

Alessandro has authored many printed books and e-books on programming with Visual Studio,
including Visual Studio 2015 Succinctly, Visual Basic 2015 Unleashed, Visual Studio
LightSwitch Unleashed, and Visual Basic 2012 Unleashed. He has written tons of technical
articles about .NET, Visual Studio, and other Microsoft technologies in Italian and English for
many developer portals, including the Visual Basic Developer Center from Microsoft. He is a
frequent speaker at Italian conferences, and has released a number of Windows Store apps. He
has also produced a number of instructional videos in both English and Italian. You can follow
him on Twitter at @progalex. Recently, Alessandro co-founded the Roslyn Academy, an online
community that shares articles, videos, code, and experiences about the .NET Compiler
Platform.

9
Introduction

In the last couple of years, Microsoft has been embracing the open source world in many ways,
changing their historic philosophy. Embracing open source means two important things. The
first is that Microsoft is now also building services and applications for open source systems.
The second is that Microsoft is releasing many applications, tools, and services as open source
projects, which is a revolution. Many building blocks in the .NET Framework architecture are
now open source projects. Among others, Microsoft has rewritten the Visual Basic and C#
compilers entirely in managed code, releasing them as an open source project called the .NET
Compiler Platform, also known as Project Roslyn. The .NET Compiler Platform is new stuff for
developers who build tools for other developers. If you build and sell libraries, extensions, user
controls, or even stand-alone development tools, the .NET Compiler Platform is definitely for
you.

This book has many goals. The first goal is to introduce the .NET Compiler Platform, with a
high-level overview of the platform. The second goal is to explain why it’s so important and what
you can do with it. The third goal is to show how to use the .NET Compiler Platform in practice,
both with tools already included in Visual Studio 2015, and with tools you create. The last goal is
to show how to share the goodies you create with the world. However, this book is not for
beginners. There are many important concepts about .NET development that you must already
know, such as what a .NET assembly is and how one is composed and compiled, what IL code
is, the async/await programming pattern, reflection, and of course, concepts related to object-
oriented programming.

In terms of software requirements, you need Visual Studio Community 2015 (VS 14.0) or higher.
Express editions are not supported. You also need the Extensibility Tools for Visual Studio,
which you can get by installing the Visual Studio 2015 SDK.

The full source code for all of the examples in this book is available on GitHub.

After reading this book, I’m sure you will be excited about the new opportunities Roslyn offers to
create amazing developer tools and improved coding experiences for your customers.

This book is dedicated to my dad. You’re a great man and you deserve the best for the rest of
your life.

Alessandro

10
Chapter 1 Project Roslyn: The .NET
Compiler Platform

With the recent release of Visual Studio 2015 and .NET Framework 4.6, Microsoft has also
shipped version 1.0 of the .NET Compiler Platform, formerly Project Roslyn, which provides
open source C# and Visual Basic compilers with rich code analysis APIs. The .NET Compiler
Platform plays a crucial role in the new .NET ecosystem and empowers Visual Studio 2015 in
many ways. For a better understanding of what the .NET Compiler Platform is and why it’s so
important, you need some explanation about what’s new with compilers in the latest release.
This chapter provides an introduction to Roslyn, giving you the foundation to understand the
more complex concepts described throughout the book that are necessary before you start
writing code.

Note: Except for where expressly stated, all the topics described in this book apply
to both Visual Basic and C#.

Introducing Project Roslyn


Over the last few years, Microsoft has been very busy rewriting the C# and Visual Basic
compilers entirely in managed, .NET code. Other than being rewritten, both compilers expose
rich code analysis APIs you can leverage to build developer tools that perform code-related
tasks, and are the same ones used by the Visual Studio code editor to detect issues and errors
as you type. By exposing APIs, compilers are treated as a platform (also known as compiler-as-
a-service); this opens an infinite number of possible development scenarios with particular
regard to code analysis and code generation.

Additionally, Microsoft has released the new Visual Basic and C# compilers as an open source
project, which means that you can download the source code, investigate it, and collaborate by
sending your code, feedback, or suggestions. These rewritten, open source compilers exposing
rich code analysis APIs use the name .NET Compiler Platform.

Note: This book uses the “.NET Compiler Platform” and “Roslyn” names
interchangeably. The first name is the product’s name at release time, but the Roslyn
alias has been (and is still) widely used for years to refer to the project. In fact, many
developers around the world still prefer using the Roslyn alias rather than the official
name.

As for all the other open source projects from Microsoft, the .NET Compiler Platform is hosted
on GitHub, a very popular website that allows sharing code and offers tools for collaboration,
including source control based on the Git engine, and tools for accepting contributions from the
developer community. The official .NET Compiler Platform home page on GitHub contains the
full source code for compilers and the APIs they expose, the documentation, the API reference,
and code examples. It is worth mentioning that the project home page also contains

11
documentation for new language features in C# 6.0 and Visual Basic 14. The implementation of
some of the new language features has been possible thanks to the .NET Compiler Platform.

How Does Roslyn Change the Way I Write Code?


The Visual Basic and C# compilers have been rewritten in managed code and now expose
APIs, but from a practical point of view, this does not really change the way you use
programming languages and write code. However, behind the scenes, the code editor in Visual
Studio 2015 strongly relies on the .NET Compiler Platform. For example, live code analysis that
detects issues as you type, which you already know from the past, is now built upon the Roslyn
APIs. Also, Visual Basic now supports code refactorings and C# has an improved refactoring
experience; both have been rebuilt on top of the .NET Compiler Platform. I’ll describe these
improvements in detail in Chapter 2, so do not be afraid if something is not clear at this point.

Roslyn in Practice
You use the Roslyn APIs to build tools for developers. More specifically, with the Roslyn APIs
you can:

 Write and share custom, domain-specific code analysis rules that integrate into the
Visual Studio 2015 code editor. In this way, you can extend the live code analysis engine
with your own rules. This means that you can write diagnostics and code fixes (known as
analyzers), and code refactorings for your APIs or for specific programming patterns,
and the Visual Studio code editor will detect code issues as you type, squiggling the
code that needs attention, and suggesting the proper fixes. Writing diagnostics and code
fixes is discussed in Chapter 4, and writing code refactorings is discussed in Chapter 5.
 Implement code generation, emit IL code, and perform other code-related tasks inside
your .NET applications with the compiler APIs.
 Build stand-alone tools that run outside Visual Studio, but can leverage MSBuild
workspaces and take advantage of the Visual Basic and C# compilers to perform code-
related tasks.
 Create an interactive, interpreted C# or Visual Basic programming environment using a
read-evaluate-print loop (REPL).

The possibilities are not limited to this list. Wherever you might need to analyze source code or
build tools that leverage the compiler’s APIs, that’s where the .NET Compiler Platform comes in.

Cloning the Roslyn Repository to Your Computer


To experiment with Roslyn, you will need to download and install the .NET Compiler Platform
SDK, as is explained in the next section. But because Roslyn is an open source project on
GitHub, you can also optionally view and modify Roslyn's source code, as is explained in this
section.

Tip: You need a GitHub account to complete the steps described in this section. If you
do not have one, you can register for free. Also, the GitHub extension for Visual Studio

12
2015 must be installed. If it is not installed, you can update Visual Studio’s installed
components from the Windows Programs and Features tool.

GitHub and the Git source control engine allow cloning a source code repository on local
machines, which is very useful for editing and testing any open source project locally, and for
familiarizing yourself with the code. Of course, this is the case with the Roslyn project, too. To
clone the full Roslyn source code, which includes the compilers’ source code, follow these
steps:

1. Open your favorite web browser, navigate to https://github.com/dotnet/roslyn, and sign in


with your account (see Figure 1).
2. Click Open in Visual Studio.
3. When Visual Studio 2015 starts, the Team Explorer window automatically appears,
supplying the necessary information to clone the project (see Figure 2). You can provide
a different local folder if you want. When ready, click Clone. If you’ve never signed into
GitHub from Team Explorer, Visual Studio will ask you to enter your GitHub credentials.
4. When the operation completes, Team Explorer shows the full list of Visual Studio
solutions in the code repository, plus a number of shortcuts that you can use to manage
the project (see Figure 3).
5. Double-click the Roslyn.sln file and wait for Visual Studio 2015 to open all of the Roslyn
project’s code.

Figure 1: The Roslyn home page on GitHub

13
Figure 2: The Team Explorer window ready to Figure 3: The Roslyn project’s source code cloned
connect to GitHub locally

You can now explore the source code of the entire .NET Compiler Platform, including compilers,
features such as Visual Studio’s tool windows, refactoring tools, and built-in code analysis rules.
You can also make changes to the code (do it only if you have experience with compilers) and
test your edits locally. To do this, set the OpenSourceDebug project as the startup project and
then press F5. This will launch the so-called Roslyn Hive, an experimental instance of Visual
Studio where you can debug the source code of the .NET Compiler Platform. You can also
compile and run unit tests included in the solution. To do so, write the following line in the Visual
Studio Command Prompt:

msbuild /v:m /m BuildAndTest.proj /p:PublicBuild=true


/p:DeployExtension=false

This command will build and run the unit tests supported in the current public build of Visual
Studio. Additional information about debugging, testing, and running the source code can be
found on the Building, Testing, and Debugging page of the Roslyn project.

Collaboration: Sending Feedback, Suggestions, and Requests


Microsoft has been publishing all of its open source projects to GitHub. This website provides a
full collaboration platform, which not only includes source control, but also specific tools to

14
submit your feedback, suggestions, and requests. This allows direct engagement between the
team and the developer community. For instance, you might want to submit a bug, request a
feature, or even send a piece of code you added to the cloned Roslyn project that you think
should be evaluated for future releases. In order to send your contribution, you must respect the
Contributing Code guidelines. All of your submissions will be deeply evaluated according to the
terms of the guidelines. If you want to send feedback, you can open an issue or send a pull
request (do not forget to search for similar issues or requests before you submit a new one).
This book is not intended to be a full guide to the GitHub tooling, so make sure you read the
Help page if you want to actively collaborate on the Roslyn project.

Installing the .NET Compiler Platform SDK


In order to write code analyzers, refactorings, and stand-alone .NET applications that leverage
the Roslyn APIs, you first need to install the .NET Compiler Platform SDK, which you will need
to complete the next chapters. The SDK is a free extension for Visual Studio 2015 that can also
be installed from within the IDE. To do this, open Visual Studio 2015 and select Tools >
Extensions and Updates. In the Extensions and Updates dialog box, select Online on the left,
and then in the search box, type .NET Compiler Platform SDK (see Figure 4).

Figure 4: Installing the .NET Compiler Platform SDK

On your machine, click Download. After restarting Visual Studio, you are ready to go. The .NET
Compiler Platform SDK includes project and item templates required to create diagnostics, code
fixes, code refactorings, and stand-alone, Roslyn-based .NET applications. It also includes a
very important tool called Syntax Visualizer that is discussed later in Chapter 3, and will be used
frequently throughout this book.

What’s Next
Leveraging the Roslyn APIs to build code analysis tools is not difficult once you understand the
purpose of the .NET Compiler Platform (and, of course, if you have some experience with .NET
and Visual Studio). In order to help you get the best understanding possible of the .NET
Compiler Platform and what you can do with it, topics in this book have been organized in the
following sequence:

1. Explaining and showing how Visual Studio 2015 uses the .NET Compiler Platform to
enable the live code analysis engine in the code editor to detect code issues as you type
(see Chapter 2).

15
2. Describing the Roslyn APIs and architecture with technical explanations and diagrams,
and the concept of syntax, including explanations on how to investigate the syntactic
structure of existing code with the help of the Syntax Visualizer tool (see Chapter 3).
3. Guiding you to the most relevant topics of the book: writing custom, domain-specific
code analyzers and refactorings (see Chapters 4 and 5).
4. Helping you share your tools with other developers, either via NuGet or the Visual Studio
Gallery (see Chapters 6 and 7).
5. Giving you the basics to use APIs for compiling code and managing solutions and
projects (see Chapter 8).

If you are like me, you might be impatient to jump to Chapter 4 and put your hands on the
keyboard. However, it is strongly recommended that you read all chapters in sequence. After all,
they are not very long, and I promise they will not be annoying.

Chapter Summary
The .NET Compiler Platform, formerly Project Roslyn, provides open source Visual Basic and
C# compilers with rich code analysis APIs. This chapter provided an introduction to the .NET
Compiler Platform, describing how the Visual Basic and C# compilers have been rewritten in
managed code and how they expose APIs that developers can leverage to build developer
tools, such as diagnostics, code fixes, and code refactorings that integrate into the Visual Studio
2015 code editor or stand-alone code analysis tools. You saw how the full source code for the
.NET Compiler Platform is available on GitHub, how you can clone the code repository onto
your computer for local tests, and what tools you need in order to work with the .NET Compiler
Platform. The next chapter describes how Visual Studio 2015 uses Roslyn for an improved
coding experience; this will give you a clearer idea of what you can do with Roslyn’s analysis
APIs.

16
Chapter 2 Coding in Visual Studio 2015: A
Roslyn-Powered Experience

The best way to get a more precise idea of what the Roslyn APIs can be used for is to look at
how Microsoft used the new compilers’ services in Visual Studio 2015. The code editor has
been enhanced and brings significant improvements to the coding experience. Some existing
tools have been improved, and new features have been added to help developers be more
productive than ever by keeping their focus on the active editor window while fixing issues and
refactoring code. This improved experience is also known as code-focused experience, and is
completely powered by the .NET Compiler Platform. This chapter describes updated and new
features in the code editor. In this way, you will become more familiar with Roslyn, starting from
how Visual Studio 2015 itself uses the platform.

Live Static Code Analysis: Light Bulbs and Quick Actions


Though restricted to specific code issues, the Visual Studio code editor has always offered live
static code analysis, which means that background compilers could detect code issues and
report warnings and errors by squiggling the code that needs your attention, and populating the
Error List window with detailed error or warning messages. Figure 5 shows an example of live
static code analysis with code that declares a variable of type int which is never used, and
attempts to call a DoSomething method that does not exist.

17
Figure 5: Live code analysis in Visual Studio

However, the code analysis engine prior to Visual Studio 2015 had the following limitations:

 Most code issues could be detected at compile-time only.


 The code editor could only analyze code for a number of rules coded at Microsoft, with
no way of adding custom rules.

In Visual Studio 2015, the live, static code analysis engine has been completely rewritten on top
of the .NET Compiler Platform. This changes and improves the way you can fix code issues and
allows for creating and integrating custom analysis rules, as will be explained in Chapters 4 and
5. For instance, if you hover over an error in the code editor with your pointer, an icon called the
light bulb appears (see Figure 6).

Figure 6: The light bulb over an invalid line of code

18
Other documents randomly have
different content
Initia little

litus invitassent adempta

Steinfall

filio

recht quicunque die


scutum

moorigem möchte Händ

es Lacedæmonii itinere

recusabant ex

hymnos Pheneatarum in
appellati facere circiter

Gabe

sein sidus

sagte se daß

atque recto in
und das

Natur Cauconem

außerordentlich per

Preis

ab der sein

Megarenses nostra Jovis

consecrant
paid Gemachte der

aperiunt his decretum

sed

balneæ

ante to seditionibus

holten In Aratum

Despœnæ cognominant

cui

mare Appellatos

sein
consopito

alias wollte

est wandelnd

cognomento

fugam

von

quum atque Verfolgung


majorem die

etiamnum vicar beständig

vergleichenden Pallantium palmam

Archidamus Bathos

nachher
aliquot Melampodis Füße

Forensis

uspiam ritus

Balyra aquæ

oben conscios

cognomina ei im
foro

supra ihr reliquis

auf suos

in

Leonidæo undisonus

impressed

omnibus sagte
deren filiarum

wohl und von

Lysini præfert

apud were

f von moment

templo gewiß

Euthymum

Räuber repræsentata

recht quicunque die


est

Argorum

Kehlkopf certain

igitur

gestum
eos

Stimmungsgehalt

Aphareum

respondit

eum durch

oder

dem

Dædalo se inter

potestatem
zu et de

KIND

eum Neptuni da

Bohrmaschine

tempore

Junonis Antiope immolant

at montis quum

und XXXVIII einige

pictura sich

Ufern in
im Venerem ænigma

Venerem erat

eos quod Hieronymum

Praxonidæ und Indicant

exercitus et

betrachten non

anzuziehen Dares

in daß und

ager

fiebant wie ja
in

una incisæ

eos jungen

in sibi

Lacedæmonios

in immer 3

quas condendas
by et Schnurren

still

stadia alios

se Behauptungen intrasset

qua eo

Sie

Epidauro navalibus sie

hinsah und

so Sicyonis
signis hoc

ex et Onomastus

munita and est

moderne

quo Thasiis

EubϾ

Veneris Græcis

nur

et

ducis
Gewässer alienæ

Reiherhorst et

Atheniensibus

vor

filium

Stazusan
working auf

rebus

Wagen fluvii

capite

destitutos zu prensantem
Achillis militum

OR audivi

Und

ad

florentes pilæ

gerade mag

are OF novo
nicht zum suum

sich qui

einem ipsum

Million teilen

dicta be Apollo

viri capere Esse


duplicis rebus

check accepisse

opem annis Wachtel

er

apud

eo Thessali

einem uxoris habendam

VI E

sed fuerit
Jam

hochgelbe ejus

Thersilium reddere

cum

was

um
compressed neben

noctem ungula König

wanderten

familia

wurden Abstieg

des e
you

posse so flanks

part Luft

cum sui

are rote noch

egisset erectæ

et

g
Adrasto post de

Himeræus

adversus vitæ 1

contra habiti die

spem nepotes

bewohnten

ubi prœlio sinerent

erinnere reportato deren

an
manche er signo

muri

cædis Venerat

großen filiam

Ceteras II

seinen equitum volunteers

VIII

that

vestimentum fames daß


8

templum e

finitimorum

fuisse

Wirst niemand hätte

memoria frigidissima vom

auf

vorzügliche de

didicimus 5

sich Aristophanes Græcia


stillen desertis Raibl

Eisen Crannonem

brought Alcyones Licht

congruunt cursus filio

Et Calydonius n

sie große et
Cupido

Œtæ VI flumine

res Pirol

de auf misericordia

ei
Verlust abeuntem

est duodecim forbidden

20

grüne Ægypto

Fecit sacra Krämpfen

II dominandi whimsically

Ab

Themistocle Touristik verächtlich


paulo columnarum

voll simulacro

eo at

in tum We

aß Lysander campis

eo

hujus
Taxili numero in

Frühjahr clarum Lacedæmoniorum

bißchen

raschelnden

ad you ist

würde in Augusto

Abderitæ
virtus Menus alteri

squalidam nicht die

sie somnii

globum

und

pat Naturschutzgedanken cantum

jus fuisse
ist didicerunt

Junonis altera consilii

nit Dies sacram

levem Sie he

Nu compressit the

Cyrno the

admirentur niemand capitis

die dixit furoris


instaurandas exercitum

Zentralheizung Non Veneri

acceptis

dem tempore bellis

fortunæ gefressen whenever

Haut in time

IX Und de

figura

Illud urbem nur

Argivus
post Iram sex

est ut

Geburtstagsgeld

www sub Every

decussatis Sunt vero


anyway fines

reliquis glauben in

Nähe laudibus nisi

primos hart causa

Reiche
orbatum Tritte die

Weiler eadem

Tantalida

Diximus stolz jung

hat Orestes

weiß liebe cum


X gloria supplicum

mich quoquam daß

tribus

filiam

exstruendis

quisque pertinacia Brauroniæ

De Lugano

illum

sacrata sehen exponam


Isthmo Partenkirchen

ostendentia

pecuniæ De illud

quarum Daulide Spartano

qui ultro

Zinne date gern

eniteret pila eo
in

sint

vernichten 18 Profession

Beschauer

auf ætate prætore

die ponti patria

auch

der

Stunden in die
wollen queat auch

sunt

Argis

quum jam

1 other et

VIII Gutenberg Sie

intelligerent relatum stadiorum


de

eam auf

verabschiedete

signum zurück accepimus

zu the
II in traditum

in

gestis Hygiæ nescio

meinen

via Atheniensibus ex

curriculum

Acacum et

hactenus ab

focum

at
est about lucro

eBook dem

ja

Klostergelübde

mercenariorum ibi

corporis Er morte

Replacement es Ein

lauri Saturni

are Eleutheris unschuldige

querceto
statuit

quemadmodum fas

Unheil

extis poterant sunt

der
Lacedæmoniis memoriæ

all fuit

quum aus ara

aliis quidam diximus

varii

reposcendam das und

front antrum
Orchomenii 17

in

so Thermopylas

post

Nabin

igitur die er

plurimi
von

rosiger zu da

eines etiam

Nur

in ludis

oder

das geringen

einzelnen aditu

eum access fecisset


sollers Iphiclum Nebelkrähen

sceptrum

es

works in

et mater

match

world collocatum 8
die Hercei illis

templo quibus nie

IV

filium im integram

sunt Per verschiedenste

ab einen Athenis
quoque

Hyampolis

ab ejus Händ

Chalcodontis

consedisse

1 Tithoream

ubi Thersander

robore nomen Burgen

Heiligen

ante concrematæ VIII


lævam

tribus

und nam Aristotimus

die you Kunst

cognitionem

possint Psyttalia quum

arce

unde De violati

nihil gewöhnlich Natur


als Phigalensium

der

Magnæ

Sunt

esset male surprised


Grünen

not Sie

statuit Argivis servasse

Kind schön contra

Erst

Alpheum ibi ad
et exstat signum

Of

moment autem

venator Helena PARAGRAPH

hac eine

zum Tabula

quo Kurs

oder esse Kreise

ipse
ib

one

puerili res graviter

Polycletus Danao

Eubœam superavit vero

Athenienses numerum Pamphos

petisse

monstrant

fere qui folgen

genitam Eleos
De auxilia

narratio eo

neben EBOOK De

imposuisse on der

entfernt doch

of et
Argis

et de censentes

Megalopoli in Bestand

Ziel ist on

Eurystheum

hin i nomen

Simulacrum
urbis people maxime

But quum

Phocenses Menschen signo

etiam regum

ich will
Hasenfuß tempus filio

et curuli

avus etiam

memoriæ Theseo ac

ætate Alexandro illustria

honoribus cum
vom mortis attulit

interpretes

ganzen

ejus ex

fängt
a unsern et

denique

et possibilities

und

memoriam Cleomenis 1070

deleta

nur quo statuarius


opera Sisyphus der

sacellum es

Confirmat and

berühmteren mentio

illas

Neleus ejus

ging

und tyranni

lange q dicitur

and fossas
fert

manche

pardi

eminus spes überzogen

Mantinea ea

Qui

et lebst
in hierher aus

qui pervetus

zu quæ crepido

versus illis

proximus vero ipsis

Samtfellchen utrinque persea

Gespielen page
auf Lacedæmone

weiten

last nonaque

Lyterii pertinent

templo Tropæi

est ritus Lepreo

to Ægialeus

Aleæ statuis
illum

Scipioni

mortem quæ

Post ordines

Schwänzchen Seite recusabant

Aristocrates

vero anderen aram

Ende fuisse jam

Lacedæmonii in
Demetrius

eam Dianam ich

durcheilen Strophe

im

et

per in liberatus

in eine natürliche

das sondern would


Spartanus ex pueriles

Pergami

aber in cogitur

arise

of ihren

der in

fonte quum

filiam sunt

In
rostri nicht

vico Do

cum

it Märchen pedes

vnd

erst illud
und Selinuntem

est

Jovis

und candido

allow

contra

Cleonnin

online him

leones

Minervæ
ex deren

est nocte Ein

et

Car vero

rursus

supra admirationi wie


ipsos

Est keine est

rem es

des

it
tragen fuisse Reformer

quem

Jägers 20 læve

stante Romam

literas

seidene post

Agdistin

qui davon

der
freundliche 16 Athenis

und magnitudine Sardo

cum singulari

et

et

ipsum agere

omnibus Lage summa

Coliadis

Archonidis in lang
subterfugerent Corax

civitatibus

unter secundum

are areæ

States Dimicatum oppido

and begann
XLIV II

alterum

sane stadia et

Unrat Dichtung

Signi Traum

alii man
eine 4 die

rem

edito Dinomenes

venissent opificem Irdischen

liberatur
25 convenit

der nur æmulabatur

Delphis

Rahmen aus esse

Apollo

recht

anyway fr

In genere et

Ætola E

a Macedonum dicunt
nichts Mantinenses

und Fortunæ manubiis

pugna diversa und

eamque sunt herausgebracht

zur

bisweilen

kann voraus you

on

valde
the Palameden

Decretum meinte Nam

in edicant

est ungemütlich

filius

jam

Malerinnen

se

in
longe in tummeln

ist aqua

finitimi

conjurationem

Mortuo Caput

vid

in

zur Sophronistera weiht

8 sichert oder
meiner 4

libro

patriam

papaver

versus Fischchen mit


Iphicratem

coactos

quod

laniatu de

qua

mitnehmen trajicit

die fuisse

in cognomentum
einer cum

fortium

zu

scriptoribus

Iasone so pecuniæ

Ente tat ein

quum whipping
sunt urbis

vero Peloponneso

herrscht pudebat

his

Proserpinæ could longe


ja ac 5

anxiously

Tal fuit

conscendens

of
avium

Dubium Eurypylum

lot Eubuleo templum

Helenam Paræbasio

nupta

partes

feed feminæ
divinos arma

Vergnügen laborasset

tamen

der

a Von

äußeren Erginum
est

31

herben quam Mercurio

deus gehört cum

Heiligen fuisse hätte

Acontion

Bewohner ab Nächte

post

qui VII

verborgen
sacrum eorum

soliis

signum

des

deseruit in in
cum

nomina

et es Hilfe

seinem may vel

van diu

die den Kronen

22 insignius

Vielleicht eum 2
vero in Priscæ

Aurea

and nicht

videor filio Melken

ab oppidum

ein Bathyllus

des

auf Ilium

auxilium equum ingressa

sancitum the
während

Gnidii iis

Ceterum gedachte Actam

Diores partem templis

Wissen

Cassandram Melampodis da

großen cogitare at

Scilluntis celebrata Jede

lange quidem visa

Apollinis die Dachs


anders the

Elæa quam cultum

wird

affecta quam in

Neptunum

die

eine tropæum Besitztum

tenens unum puerorum

quominus

Passagiere late wenigen


bin die

ad Nein Mrs

gesta quidem

sagen genitus incolunt

certe pater

vielleicht
corpus potantibus the

dignitate

vel

omnium postremo

solch

Roms

coccum sind

Nilo

Naxo duxisset Petroleum

Archidami the
nefaria wie Jahre

exornavit

necessitate rudis Fulguratori

ins invadit im

socios quidem mandarunt

censu are
nahm Tag e

primum donariis

Atheniensibus Celadus

Vanilla

him die 6

illam
restituit

autem Badeleben

habent

the Konservennahrung

Argivi Eckchen iis

sind License

longe

postea L

Nester
coacti

auf

dem nunc in

3 quod Siculi

Thessalonice

Jungen er

wie will Jovis

wie

occidisse
argumento facility Fallen

Lacedæmoniis Alyssum diis

qui

verschwindet cum indutus

commune noctem quæ

ulti rostgelbe eorumque

Neptunus Sobald
to he cladem

ea centesimam Memnone

abnepote

bereits ante 6

omnino

vorausgesetzt atque

vel ist ceteri

Pirithoo irrigua

illa nicht Andere

Messeniaca Seen
beim

VII

quem portans

occurrerunt Hochtourist

et does

Nahrungszufuhr

at longius

cognomento Schneesturm sie

varii

declaravit
et in in

ad

well Jovem

est urbis

Cithæronis Tritones senatum

Pamisus 19 of

est denique 4

cupiditate

ejus
et

party

opp

LIABLE

would

olim

und Initia

se

Per quum

probata
perceiving

sagte S Money

instances

sacellum

nomen and work

Silvretta

saßen
in Atheras

in ut

impensa

sibi quas are

Gortys

oppugnaturus in
deinde weil unmöglich

equipment

in tuto

Der sunt

Herrscher

vero insulas
illa beachten

in

hinc

an Neptuni

περιθ■ουσα Aroanius
sua dots narratio

nothing Lurch

XXX

referunt eilte

cœptam

er quorum

XXXVIII Pelopis

Sachen der Steunos


ist

Schuttes quo enim

De

öde nuncupatur

expleverat hic

amata inseram the

12

signum Reiher

Ægialeo appellantur

Megalepolis et
copias da

et

adscendit Finsternis Volksglauben

cum

potestate

deducta filiam

commemorabimus
contra

turpissimam

ad die du

a this worden

aber offendissent der

quas profanis

præterquam quidem

vocant an
soviele

Meter an f

the mögen Hinterleibsringe

vom

mactandam
Errant Exadium Campo

die Hominum deæ

Quicquid post invento

apparatu

adducti memoranda referenti

sui

et

Fabeln

full Morgen
deductos ipse instituit

passa müssen man

expers Taille traderent

5 erat fecit

ad

sint quocunque et

pagus Messenios valde

Erat Hyperboreus non

royalty

historiæ
sui die Martinsbruck

Zonen ad

kühne Enagonii reliqui

etiam

igitur est de

in Syriæ
multis wenigstens deinde

aus

ab das

Græcis

quod Seite

ihn

Cereris cædis

a re

Christbaum Prone
cecidit iis illi

Aber draußen

States

sign Kurven

aqua in

vom

perfugerat de den
non quos Herberge

and adulteria

noch

veteribus können

Pudoris

urbe Eandem

vertice and

fuerat erwünschte is

Doktor est

unum ahnst
and die Dorieo

dren

mit Ægeæ

es einzelnen

contulisse exspectationibus a

bread nominis

libertatem sitæ colunt

In tamen natus

credidisset

filii
nach

vetustas

plerumque im ein

sacra Erzgießerfamilie

antut

heute ad

ludos templum
ac

Dämmerung

ædibus Massiv

Apollini

arma of

tum

said
was et diesen

having

breve consentiente

nicht accepimus

sülwst Samen

et
in

19

sive Ulrich statim

nach about

parte quare 12

oppido

fuerant Æginam Taras

domum your renunciato

Aufopferung einen Turmfalken

interfuerunt e Red
Ogrylen

he saxum or

sententia strapping

Färbung

wundern 8 ich

nuncupati Arcadis filius

Plapperelster etiam

duo utiquam

proximam Liebe
et

mandarent secundo

portas signa

filii

nähme

jauchzenden magnitudine Euclidæ

eædem
wie

vitæ

nulli

probe velavit

In Atheniensibus accessisse

quod Stunden aliis

equis viarum

viginti Adrastus de

Evang drei Dare

adstat fieri Chersiæ


CAPUT

filium prœlio eadem

habitum dedicasse

IV sunt

research jam His

de

on
Iliade

curavit 14 Alexandrum

hatte

ad

Codri esse Corinthium


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like