View on GitHub


ConsolR enables you to execute C# code against a running .NET web application

Download this project as a .zip file Download this project as a tar.gz file


ConsolR enables you to execute C# code againt a running .NET 4.0 web application's app domain through a browser. Once installed, ConsolR will automatically configure itself during application start and is accessible through the "/consolr" path. This enables an interactive console session against for instance an application's production environment.

It can be used for a number of things, but is mostly intended for debugging purposes. Possible use cases include:

While this tool is very powerful some caution should be excersised when using it. Your use of it is at your own risk. Always remember that you're running the code inside of your application's appdomain. This means that you can access and modify the application's state and run any code you want, which could render the application useless or harmful. Also make sure to always use HTTPS for transferring sensitive information.

ConsolR is based on the excellent Compilify project by Justin Rusbatch.

Installing with NuGet

Open your package manager console and install the package:

Install-Package ConsolR

Running ConsolR in a website

Simply install the ConsolR NuGet package in your .NET 4.0 web application and access the ConsolR interface on "". The default username and password is "foo" and "bar" (make sure to change these before deploying to your production environment).

The NuGet package will add all dependencies along with required assets and configuration:

Configuring ConsolR

When the ConsolR nuget package is installed three application settings will be added to your web.config in the <appSettings> section:

Make sure to change these username and password before deploying the application to production servers. We also recommend changing the root path so users won't be able to detect whether you're using ConsolR.


If you're running your ConsolR-enabled application on AppHarbor you can configure these setting with "Configuration Variables". This way you can avoid including sensitive information in your configuration files, which in turn might be tracked in a version control system.


A couple of handy helper methods are readily available in the ConsolR.Hosting.Helper class. Currently you can call ReadFile(string filename) and Log(string message). Feel free to add more as you see fit and send us a pull request so we can merge it in.

The Log method enables you to broadcast messages back to your browser window by using the SignalR connection that is established when executing code. This can be useful if you want to follow the execution of your code and is also an example of using features avaiable in the AppDomain to create a more interactive experience.


MIT License