Writing an application based on the Compiler Semantic API to display diagnostics and overload resolution results
In this section, we will write a C# console application based on Roslyn Compiler APIs to create a compilation from the given source file and then perform the following semantic analyses:
- Compute and display the compilation diagnostics that would be produced by the C# compiler if the file were to be compiled.
- Compute the
symbol info
for each invocation (method call) in the source file and display the following semantic information for each call:- Overload resolution result (https://msdn.microsoft.com/en-us/library/aa691336(v=vs.71).aspx): Success or failure reason.
- If overload resolution succeeded, the method symbol bound to the invocation.
- Otherwise, if overload resolution failed and we have one or more candidate symbols, then display each candidate symbol.
Getting started
You will need to have the Visual Studio 2017 Community Edition installed on your machine to execute this recipe....