I'm working on a code report project.
Currently, I'm able to compile the solution projects, get the diagnostics related to the compilation, etc.. 
The problem appears when I try to load my custom IDiagnosticAnalyzers, I've tried to use the AnalyzerFileReference and the AnalyzerImageReference without any result, Always I access the projects.Analizers are empty.

```
var inmutableArray = (new List<IDiagnosticAnalyzer>
    {
        new VariableEndedWithIdNamedCorrectlyDiagnosticAnalyzer()
    }).ToImmutableArray();
var analyzerImageReference = new AnalyzerImageReference(inmutableArray);

foreach (Project project in solution.Projects)
{                  
    project.AddAnalyzerReference(analyzerImageReference );
    //No analizers loaded....
}

```

UPDATE (thanks for the feedback [Josh Varty])

I've tried this two ways:

```
var newProjects = new List<Project>();
foreach (Project project in solution.Projects)
{
    var newSolutionn= solution.AddAnalyzerReference(project.Id, analyzerImageReference);
    newProjects.Add(newSolutionn.Projects.FirstOrDefault(p=> p.Id == project.Id));
}

```

---

```
foreach (Project project in solution.Projects)
{
    var newProject = project.AddAnalyzerReference( analyzerImageReference);
}

```

In both cases have the analyzers loaded but when I get the compilation and I get the diagnostics, I don't get the output related to this analyzers (I think they are not being called at the get compilation function).

```
var compilation = newProject.GetCompilationAsync().Result;

var diagnostics =   compilation.GetDiagnostics();

```

Any suggestions?