Refreshing Analyzers

Topics: APIs, General
Aug 27, 2014 at 3:39 PM
I have a project "A" that references the output of an "Analyzer" library project.
Once the analyzer is added to project "A" any changes that I make in my "Analyzer" library are not refreshed. The only way that I get the analyzer to refresh is by closing and re-opening visual studio.

Is there a setting or something that I have to do to ensure the analyzers get refreshed?
Aug 27, 2014 at 7:36 PM
Unfortunately analyzers cannot be treated the same way as normal project references. In order to run your analyzer in the editor we need to load it into the Visual Studio process. Once we do that there is no safe way to unload the analyzer assembly. If we had support for collectible assemblies then we could safely unload (and reload) the analyzer assembly. As it stands today there is no solution other than restarting VS.
Aug 27, 2014 at 7:58 PM
I managed to find a workaround to the aforementioned issue, it is not pretty but so far it has been working for me. I created a NuGet package for the "Analyzer" library and publish to a local feed. I have the version number of the package update during build. I manually uninstall the package and install it again. I tried the update-package command with the re-install option and that did not seem to work. Only uninstalling and installing again works for me at the moment.