Using the following code, we are able to set the CodeAnalysisRuleSet XML node in a *.csproj file:
EnvDTE.Project project;
foreach (Configuration c in project.ConfigurationManager)
{
c.Properties.Item("CodeAnalysisRuleSet").Value = filename;
}
Now we would like to do the same for the "RunAnalyzers" property, but we get an exception when we try to set the property. Probably that property is not exposed through the EnvDTE.Project object.
c.Properties.Item("RunAnalyzers").Value = true;
Does somebody know the correct way to achieve this please? The intention is to be able to turn on and of code analysis from withing an extension.