This project is read-only.

Roslyn Diagnostic with Code Fix: Analyzing Web.config file

Topics: APIs, C# Language Design
Oct 28, 2014 at 12:13 PM
Hi guys,
I've been playing with Roslyn Diagnostic with Code Fix for local declarations. I'm trying use the same approach to be able to analyze a ASP.NET Web.config file within the solution.

I would like for instance to enable custom errors in the Web.config file. It is the same approach of doing the diagnostic and the code fix but just focused on the Web.config.

Is it possible to do it?

Thank you.
Oct 28, 2014 at 2:43 PM
Edited Oct 28, 2014 at 2:49 PM
Roslyn diagnostics are being loaded by the C# and VB compilers and workspace tools - which are only used for .cs and .vb files.

I think that to do the same for other files, you'll have to write a Visual Studio extension that rummages through the solution for web.config files and tells Visual Studio to add items to the error list and squigglies to the corresponding document editor (or maybe you get the squigglies for free by placing items in the error list).