DotVVM 1.1.5 with New Features

Published: 8/10/2017 10:29:00 AM

We have been working hard on the upcoming release of DotVVM 1.2 which should be shipped later this year. But in the meantime, we are adding new features to DotVVM 1.1.

 

Today, we have released DotVVM 1.1.5 to the official Nuget feed. In addition to several bug fixes and it brings three new features - Parameter Binding, support for Application Insights and MiniProfiler.

 

Parameter Binding

Reading parameters from routes or query string has never been really convenient in DotVVM. There were two dictionaries you could use for this purpose: Context.Parameters and Context.Query.

The usage was pretty complicated - you need to call ContainsKey first to make sure the parameter is there, and then do all the type conversions.

int? customerId = null;
if (Context.Parameters.ContainsKey("id")) 
{
   customerId = Convert.ToInt32(Context.Parameters["id"]);
}

With parameter binding, it is much simpler now. You just need to declare a property and mark it with the FromRoute or FromQuery attribute:

[FromRoute("id")]
public int? CustomerId { get; private set; }

DotVVM will look in the route parameter collection and if the parameter is there, it loads the property with the value and does all the conversions.

 

Application Insights Support

We have added support for Azure Application Insights, which is part of the DotVVM.Tracing.ApplicationInsights and DotVVM.Tracing.ApplicationInsights packages.

You will not lose any exception which occurs during the page or command execution, and we also gather several metrics during the HTTP request execution. For example, you can see how long the PreRender phase tool, how much time DotVVM spent with serialization of the viewmodel and more.

DotVVM metrics in Microsoft Azure portal

The configuration is very simple, you just need to install the correct NuGet package (DotVVM.Tracing.ApplicationInsights.Owin or DotVVM.Tracing.ApplicationInsights.AspNetCore) and turn this feature on:

// OWIN
var dotvvmConfiguration = app.UseDotVVM<DotvvmStartup>(applicationPhysicalPath, options: options =>
{
    options.AddApplicationInsightsTracing();
});

// ASP.NET Core
services.AddDotVVM(options =>
{
    options.AddApplicationInsightsTracing();
});

You can find more info in the documentation.

 

MiniProfiler Support

If you don’t want to use third-party service, you can still access diagnostics data easily from your application thanks to the MiniProfiler library.

MiniProfiler widget

 

Again, you just need to install the correct NuGet package (DotVVM.Tracing.MiniProfiler.Owin or DotVVM.Tracing.MiniProfiler.AspNetCore) and then enable the tracing in the configuration.

// OWIN
var dotvvmConfiguration = app.UseDotVVM<DotvvmStartup>(applicationPhysicalPath, options: options =>
{
    options.AddMiniProfilerEventTracing();
});

// ASP.NET Core
services.AddDotVVM(options =>
{
    options.AddMiniProfilerEventTracing();
});

Then, you should use the MiniProfilerWidget control to render the tracing window in the top right corner of the page:

<dot:MiniProfilerWidget Position="Right" ShowTrivial="true" StartHidden="true" />

If you open http://yourapplication/profiler/results-index, you can see a complete history of your requests with detailed statistics:

MiniProfiler request history

You can find more details in the Documentation.

 

 

DotVVM Business Pack RC 1

Together with the release of DotVVM 1.1.5, we have also published the RC1 version of DotVVM Business Pack library. Join our free Beta program to get access to it! And we are shipping the RTM version at the end of this month. Stay tuned and follow us on Twitter so you won’t miss any news.

 

We'd love to hear from you! Share your thoughts with us on our Gitter.

Tomáš Herceg

I am the CEO of RIGANTI, a small software development company located in Prague, Czech Republic.

I am Microsoft Most Valuable Professional and the founder of DotVVM project.