0
votes

Does Roslyn compiler in Visual Studio 2015 provide continuous compilation? I thought while I am writing code, the compiler is compiling in the background and the app is ready to run right away but it seems VS has to compile first and I notice the delay of a few seconds until the build succeeds. Are there settings or tools to speed up this process?

Update
I use Resharper so I get the real time indicators for errors and warnings. I also used to use RedGate's .NET Demon VS extension (retired since VS2015) which did continuous compilation and saved the file continuously while typing. It was a very handy tool. I don't see Roslyn being able to replace these two combined.

2
The way I understand it, certain aspects like syntaxtree parsing are done continously (which is why you see errors and warnings as you type) while other aspects like emitting to disk and emitting debug info are done when you actually build. This is mostly speculation though so someone should confirm/clarify this. - Jeroen Vannevel
JetBrain's dotCover seems to support continuous testing. Since continuous compilation is a subset of that, you might be able to use that. - svick
@svick if dotCover works like NCrunch, then that might not be the case. NCrunch does continuous testing. It saves the compiled assemblies in its own bin folder for its own use. - Tony_Henrich

2 Answers

1
votes

Visual Studio 2015 has no such built-in feature. When you hit build we always use an out-of-process compiler to do the actual build, which ends up doing a full build behind the scenes.

Aside: The old VB IDE we replaced with Roslyn did try to do this, where data was kept as up-to-date as possible and F5 could in theory just stream the executable out on disk. In a lot of cases, this didn't work because when you hit build some other process would run (like a .resx file or .xaml file generating a .vb file) which would invalidate what we had precomputed and require us to start from scratch in the end. Honestly I don't know how often it actually worked like planned in any "real world" project.

1
votes

I am currently using Autosave which seems to be more reliable than the solution below. SaveAllTheTime wasn't saving all the time!


Old answer: There are two Visual Studio extensions which, together, effectively enable you to do continuous compilation. This is a time saver because I compile tens of times a day. The extensions are BuildOnSave & SaveAllTheTime.

Thanks to Sergey Vlasov for the tip.