Closed suprak closed 9 years ago
I set breakpoints in both methods, and only the Start Compilation one fires.
I had the same issue today. However, in my case I have proof that the compilation end action does execute: it reports diagnostics. It's just that breakpoints don't get hit.
I tried everything I could think of: compiling against net47 instead of netstandard1.3, enabling native code debugging, using Debugger.Break(), even throw null;
and several combinations of the above. Even though the code does execute, the second breakpoint doesn't get hit.
@KrisVandermotten all compilation wide work happens out of proc (ServiceHub.RoslynCodeAnalysisServiceXX.exe) due to its heavy allocation potentials. you need to set breakpoint on that process to debug it.
@heejaechang Do you know if there is a way to simplify attaching to this external process? I am currently making it wait for a debugger using
while(!Debugger.IsAttached)
{
Task.Delay(100).Wait();
}
from the beginning of the CompilationAction callback, then attaching to it. I am just curious if there is a better way.
the external process will start as soon as a solution is opened. and CompilationAction call back will be called every time you modify code in VS. so I dont think you need "Wait" like the above?
or, are you asking whether there is a way to attach 2 processes (VS and the RoslynCodeAnalysisService) at the same time?
I did not realize it was started with the solution. That simplifies things, thanks! 👍
I'm running into an issue with VS 2015 + Roslyn v1.
I read through the analyzer semantic documentation[1].
According to it, I expect that the compilation action I registered in the Initializer, to be executed once at the end of a compilation.
However I am not getting this behavior. The StartCompilation action gets called, but the End never does. Is this a bug? Am I doing it wrong?
[1] https://github.com/dotnet/roslyn/blob/master/docs/analyzers/Analyzer%20Actions%20Semantics.md