The roslyn compiler found in Visual Studio 14 enables us, to adjust C# code during runtime, by compiling the new C# code in-memory. Now we can edit the UI part (HTML, CSS, JavaScript) of a single page app, including the backend C# ASP .NET Web Api service dynamically in runtime.


On of the things, that disrupts my workflow, when creating a single page app with AngularJS, backed by a web api C# service in Visual Studio 2013, is the fact that, when I find a bug in my C# code while testing the UI, I have to stop the debugger, adjust the web api C# code, re-compile, re-run and then recreating state in the web app before I can resume testing the UI.

This pain will go away, when using Visual Studio 14


Download and install Visual Studio 14 CTP 3 from

Open Visual Studio, choose File > New > Project …






Start the web application by pressing CTRL + F5 (so don’t start the debugger).




Click on the Contact page in the browser:

You will see the text “Your contact page”.



Now go to the Controllers\HomeController.cs



Adjust the the C# code: ViewBag.Message = "Your contact page.";


ViewBag.Message = "My contact page.";




Save the file and in the browser press F5, you might see a short delay, because the roslyn compiler is now dynamically compiling the code.


The C# code is changed without disrupting my workflow.



One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.