I've long thought the pattern for bundling files, that included the version number was ugly, and was a barrier to quick upgrade of Kendo versions. Now that we have a private nuget, I wanted to make upgrading versions easier.
As an idea I came up with the following : this removes all version constants from the bundling and layout. It would be nice if there was a static Version getter on the Kendo class though :-) Kendo.Version would make it much clearer (hint!)
//BundleConfig.cs
var version = typeof(Kendo.Mvc.UrlGenerator).Assembly.GetName().Version;
var kendoVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
bundles.Add(new StyleBundle("~/Content/kendo/"+kendoVersion+"/css").Include(
"~/Content/kendo/"+kendoVersion+"/kendo.common.min.css",
"~/Content/kendo/"+kendoVersion+"/kendo.default.min.css"
));
bundles.Add(new ScriptBundle("~/Scripts/kendo/" + kendoVersion +"/scripts").Include(
"~/Scripts/kendo/" + kendoVersion + "/kendo.all.min.js",
"~/Scripts/kendo/" + kendoVersion + "/kendo.aspnetmvc.min.js",
"~/Scripts/kendo/" + kendoVersion + "/cultures/kendo.culture.en-GB.min.js"
));
//_Layout.cshtml
@{
var version = typeof(Kendo.Mvc.UrlGenerator).Assembly.GetName().Version;
var kendoVersion = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
}
@Styles.Render("~/Content/kendo/" + kendoVersion + "/css")
/* ... */
@Scripts.Render("~/Scripts/kendo/" + kendoVersion +"/scripts")