<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://shazwazza.com/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Shazwazza</title>
    <link>https://shazwazza.com/</link>
    <description>My blog which is pretty much just all about coding</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <image>
      <url>/media/0libq25y/frog.png?rmode=max&amp;v=1da0e911f4e6890</url>
      <title>Shazwazza</title>
      <link>https://shazwazza.com/</link>
    </image>
    <item>
      <guid isPermaLink="false">1269</guid>
      <link>https://shazwazza.com/post/introducing-smidge-an-aspnet-5-runtime-jscss-pre-processor/</link>
      <category>ASP.Net</category>
      <category>Web Development</category>
      <title>Introducing ‘Smidge’ – an ASP.NET 5 runtime JS/CSS pre-processor</title>
      <description>&lt;p&gt;During the past month I decided to dive deep into learning ASP.NET 5, and what better way to learn than to start a new OSS project :)&lt;/p&gt;
&lt;p&gt;I chose to make a new new simple and extensible Javascript/CSS &lt;span style="text-decoration: underline;"&gt;runtime&lt;/span&gt; pre-processor for ASP.NET 5. It does file minification, combination and compression, has a nice file caching layer and it’s all done in async operations. I ported over a few ideas and code snippets from &lt;a href="https://github.com/Shazwazza/ClientDependency/" target="_blank"&gt;CDF (client dependency framework)&lt;/a&gt; but with a more modern approach. I’ve called it ‘Smidge’ = &lt;em&gt;something really small&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Shazwazza/Smidge" target="_blank"&gt;The project is on GitHub&lt;/a&gt;, it’s still a work in progress but its functional and there’s even some documentation! In the next few weeks I’ll get more of the code and docs updated and hopefully have a beta release out. In the meantime, you can clone the source, browse the code, build it and of course use it if you like.&lt;/p&gt;
&lt;h2&gt;Project details&lt;/h2&gt;
&lt;p&gt;It’s currently only targeting &lt;em&gt;aspnet50 &lt;/em&gt;and not the Core CLR… I didn’t start with Core CLR because there was some legacy code I had to port over and I wanted to get something up and working relatively quickly. It shouldn’t be too much work to convert to Core CLR and Mono, hopefully I’ll find time to do that soon. It’s referencing all of the beta-* libraries from the ASP.NET 5 nightly myget feeds since there’s some code I’m using that isn’t available in the current beta1 release (&lt;em&gt;like Microsoft.AspNet.WebUtilities.UriHelper&lt;/em&gt;). The target KRE version is currently &lt;em&gt;KRE-CLR-amd64 1.0.0-beta2-10760.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;I’ve put up an Alpha 1 release on Nuget, so you can install it from there:&lt;/p&gt;
&lt;div class="nuget-badge"&gt;
&lt;p&gt;PM&amp;gt; Install-Package Smidge -Pre&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There’s some &lt;a href="https://github.com/Shazwazza/Smidge/blob/master/README.md#install" target="_blank"&gt;installation instructions here&lt;/a&gt;, you’ll need to add the smidge.json file yourself for now, can’t figure out how to get VS 2015 (kpm pack) to package that up … more learning required!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;There’s certainly a lot of detective work involved in learning ASP.NET 5 but with the code being open source and browse-able/searchable on GitHub, it makes finding what you need fairly easy.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:15 Z</pubDate>
      <a10:updated>2023-03-23T15:08:15Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1324</guid>
      <link>https://shazwazza.com/post/clientdependency-18-released/</link>
      <category>Client Dependency</category>
      <title>ClientDependency 1.8 released</title>
      <description>&lt;p&gt;It’s taken me forever to get this release out purely due to not having enough time, but here it finally is. This update now multi-targets framework versions:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Core project now targets both .Net 4 and 4.5  &lt;li&gt;MVC project is now targets both .Net 4 and 4.5 for MVC 4 and .Net 4.5 for MVC 5&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;There are also a couple of minor bug fixes:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a title="https://github.com/Shandem/ClientDependency/issues/33" href="https://github.com/Shandem/ClientDependency/issues/33"&gt;https://github.com/Shandem/ClientDependency/issues/33&lt;/a&gt;  &lt;li&gt;&lt;a title="https://github.com/Shandem/ClientDependency/issues/34" href="https://github.com/Shandem/ClientDependency/issues/34"&gt;https://github.com/Shandem/ClientDependency/issues/34&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The update to the CDF .Less project is the update to use the latest .Less 1.4.0.0 version.&lt;/p&gt; &lt;p&gt;To install the CDF core:&lt;/p&gt; &lt;style&gt;
.nuget-badge code {
background-color: #202020;
border: 4px solid silver;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
color: #e2e2e2;
display: block;
font: normal normal normal 1.5em/normal 'andale mono', 'lucida console', monospace;
line-height: 1.5em;
overflow: auto;
padding: 15px;
}
&lt;/style&gt;  &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency&lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;To install CDF for MVC (less than v5):&lt;/p&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-MVC &lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;If you are using MVC 5 then you’ll need to use the MVC 5 specific version:&lt;/p&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-MVC5 &lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;To install the .Less update:&lt;/p&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-Less &lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Remember CDF also supports TypeScript, CoffeeScript and SASS!&lt;/p&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-TypeScript &lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-CoffeeScript &lt;/code&gt;&lt;/p&gt;&lt;/div&gt; &lt;div class="nuget-badge"&gt; &lt;p&gt;&lt;code&gt;PM&amp;gt; Install-Package ClientDependency-SASS &lt;/code&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:15 Z</pubDate>
      <a10:updated>2023-03-23T15:08:15Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1273</guid>
      <link>https://shazwazza.com/post/umbraco-41-benchmarks-part-1/</link>
      <category>Umbraco</category>
      <category>Client Dependency</category>
      <title>Umbraco 4.1 Benchmarks Part 1</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;This is the first installment of what will hopefully be many Umbraco benchmark reports created by various members of the core team in the lead up to the launch of Umbraco 4.1. This benchmark report is about the request/response performance of the Umbraco back-office. This compares 4 different configurations: 4.0.3 with browser cache disabled (first run), 4.0.3 with browser cached files, 4.1 with browser cache disabled and 4.1 with browser cached files. These comparisons have been done by using newly installed Umbraco instances with ONLY the CWS package installed. The benchmark results were prepared by using &lt;a href="http://www.charlesproxy.com/" target="_blank"&gt;Charles Proxy&lt;/a&gt;.   &lt;style&gt;
































.stats th {background-color:#ffffcc;color:black;}
.stats td, .stats th {
border-top:solid 1px black;
border-right:solid 1px black;
border-top:solid 1px black;
}
.stats td.first, .stats th.first {
border-left:solid 1px black;
}
.stats tr.bottom td, .stats td.bottom {
border-bottom:solid 1px black;
}
.stats tr.one { background-color:#ededed;}
.stats tr.two { background-color:#dcdcdc;}
.stats tr.three { background-color:#ededed;}
.stats tr.four {background-color:#d6f5f5;}&lt;/style&gt;  &lt;table class="stats" cellspacing="0" cellpadding="2" width="623"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th class="first" valign="top" width="110"&gt;Test&lt;/th&gt; &lt;th valign="top" width="168"&gt;Stats&lt;/th&gt; &lt;th valign="top" width="68"&gt;4.0.3&lt;/th&gt; &lt;th valign="top" width="107"&gt;4.0.3 &lt;br&gt;client cached&lt;/th&gt; &lt;th valign="top" width="69"&gt;4.1&lt;/th&gt; &lt;th valign="top" width="99"&gt;4.1 &lt;br&gt;client cached&lt;/th&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Content app&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;68&lt;/td&gt; &lt;td valign="top" width="107"&gt;7&lt;/td&gt; &lt;td valign="top" width="69"&gt;46&lt;/td&gt; &lt;td valign="top" width="99"&gt;6&lt;/td&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;687.05&lt;/td&gt; &lt;td valign="top" width="107"&gt;72.48&lt;/td&gt; &lt;td valign="top" width="69"&gt;431.41&lt;/td&gt; &lt;td valign="top" width="99"&gt;32.54&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Edit content &lt;br&gt;home page&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;50&lt;/td&gt; &lt;td valign="top" width="107"&gt;2&lt;/td&gt; &lt;td valign="top" width="69"&gt;34&lt;/td&gt; &lt;td valign="top" width="99"&gt;1&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;385.10&lt;/td&gt; &lt;td valign="top" width="107"&gt;47.28&lt;/td&gt; &lt;td valign="top" width="69"&gt;343.36&lt;/td&gt; &lt;td valign="top" width="99"&gt;12.07&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Expand all &lt;br&gt;content nodes&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;17&lt;/td&gt; &lt;td valign="top" width="107"&gt;17&lt;/td&gt; &lt;td valign="top" width="69"&gt;16&lt;/td&gt; &lt;td valign="top" width="99"&gt;16&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="107"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="69"&gt;13.96&lt;/td&gt; &lt;td valign="top" width="99"&gt;10.85&lt;/td&gt;&lt;/tr&gt; &lt;tr class="four"&gt; &lt;td class="first bottom" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;TOTALS&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;135&lt;/td&gt; &lt;td valign="top" width="107"&gt;26&lt;/td&gt; &lt;td valign="top" width="69"&gt;96&lt;/td&gt; &lt;td valign="top" width="99"&gt;23&lt;/td&gt;&lt;/tr&gt; &lt;tr class="bottom four"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;1063.62&lt;/td&gt; &lt;td valign="top" width="107"&gt;138.23&lt;/td&gt; &lt;td valign="top" width="69"&gt;788.73&lt;/td&gt; &lt;td valign="top" width="99"&gt;55.46&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: the above is based on &amp;lt;compilation debug=”&lt;strong&gt;false&lt;/strong&gt;”&amp;gt; being set in the web.config. If it is set to true, the compression, combination and minification for both the ClientDependency framework and ScriptManager is not enabled. Also, this is not based on having IIS 7’s dynamic/static compression turned on, these benchmarks are based on Umbraco performing ‘as is ‘ out of the box which will be the same for IIS 6.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Though there’s only 3 tests listed above, these results will be consistent throughout all applications in the Umbraco back office in version 4.1.&lt;/p&gt; &lt;p&gt;The 4.1 difference:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;In 4.0.3, all ScriptResource calls generated by ScriptManager were not being compressed or minified. This was due to a browser compatibility flag that was set in the base page (this was probably very old code from pre v3!).  &lt;li&gt;Script managers in the back-office have the ScriptMode=”release” explicitly set (for minification of ScriptResource.axd)  &lt;li&gt;The &lt;a href="http://farmcode.org/page/ASPNet-ClientDependency-Framework.aspx" target="_blank"&gt;ClientDependency&lt;/a&gt; framework is shipped with 4.1 and all of the back office registers it’s JavaScript and CSS files with this framework. This allows for:  &lt;ul&gt; &lt;li&gt;Combination, compression, minification of dependencies  &lt;li&gt;Rogue script/style detection (for those scripts/styles that weren’t registered with the framework will still get compressed/minified)  &lt;li&gt;Compression/minification of specified Mime types, in this case all JSON requests in the back office (namely the tree)  &lt;li&gt;Compression/minification of all JavaScript web service proxy classes (‘asmx/js’ requests that are made by registering web services with the ScriptManager &lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Much of the back office client scripting in 4.1 has been completely refactored. Most of the JavaScript has been rewritten and a ton of file cleanup has been done. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Compared to 4.0.3, this is a HUGE difference with some serious performance benefits!&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1305</guid>
      <link>https://shazwazza.com/post/client-dependency-framework-beta-released/</link>
      <category>Client Dependency</category>
      <title>Client Dependency Framework Beta Released</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;I’ve posted a new Beta release on CodePlex, you can get it here: &lt;a href="http://clientdependency.codeplex.com/Release/ProjectReleases.aspx" target="_blank"&gt;http://clientdependency.codeplex.com/Release/ProjectReleases.aspx&lt;/a&gt;. On the releases tab includes a sample web site that has most of the functionality that you can do so please download it for a documentation reference.&lt;/p&gt;  &lt;h2&gt;Newest changes &amp;amp; additions&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;Namespace and codebase changes/steamlining&lt;/li&gt;    &lt;li&gt;Proper versioning added&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Versioning is done on a global basis in the config&lt;/li&gt;      &lt;li&gt;Old versions are retained and can still be accessed from the Client Dependency URL that was previously used (if necessary) &lt;/li&gt;      &lt;li&gt;Versioned composite files names are prefixed with the version number (i.e. version 2 files will be prefixed with '2_') so it's easy to figure out which files are old &lt;/li&gt;      &lt;li&gt;The composite file map also reflects which composite file sets are under a specific version&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Provider model extended to support 2 types of providers: &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;File Registration Providers        &lt;ul&gt;         &lt;li&gt;Still comes with 2 providers: page header provider and a lazy loading JavaScript client based provider&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;      &lt;li&gt;Composite File Providers: &lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;Comes with the standard provider: CompositeFileProcessor &lt;/li&gt;        &lt;li&gt;You can implement your own provider to customize the way that files are combined, compressed, minified, etc... if the standard provider isn't exactly what you are after&lt;/li&gt;     &lt;/ul&gt;   &lt;/ul&gt;    &lt;li&gt;Forced providers! You can now force a dependency to use a particular provider. This can be useful if you want to ensure that a particular script or stylesheet is rendered on to the page differently. For example, you may want to ensure that a script is lazy loaded (using the lazy load provider) but the rest are rendered in the page header. &lt;/li&gt;    &lt;li&gt;Utility methods added to the ClientDependencyLoader for more dynamic implementations &lt;/li&gt;    &lt;li&gt;A test website is included in the release which doubles as documentation, it includes:      &lt;ul&gt;       &lt;li&gt;Standard page header provider example &lt;/li&gt;        &lt;li&gt;Forced providers example &lt;/li&gt;        &lt;li&gt;Lazy load provider example &lt;/li&gt;        &lt;li&gt;Dynamically registering dependencies in your code behind &lt;/li&gt;        &lt;li&gt;Registering dependencies with attributes and via aspx controls&lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Things //TODO:&lt;/h2&gt;  &lt;p&gt;I’ve finished off versioning so at least i can cross that off from the previous list. But there’s still more to do:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Implement functionality for jQuery CDN&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This will be a new control/attribute to easily include jQuery in your project&lt;/li&gt;      &lt;li&gt;You will have the option to select which CDN you want to use (Microsoft or Google), or you can supply an address (like your own CDN/web server)&lt;/li&gt;      &lt;li&gt;Though this framework will be included in Umbraco 4.1, we’ll be leaving this functionality out of the Umbraco build as we realize that there are quite a few installs that operate behind a firewall that won’t have access to the CDN.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Implement skeleton for Microsoft AJAX 4 CDN&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Again, this will be another new control/attribute to easily include Microsoft’s new brand of AJAX with their CDN solution&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Add support for MVC&lt;/li&gt;    &lt;li&gt;Support for JS/CSS Minification with options to disable per dependency&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The reason this hasn’t been implemented yet is that I’ve found a lot of scripts/stylesheets break with minification so we need to be able to turn this on/off on a per file basis&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Some more documentation/examples in the example web application&lt;/li&gt; &lt;/ul&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1307</guid>
      <link>https://shazwazza.com/post/clientdependency-now-supporting-mvc/</link>
      <category>Client Dependency</category>
      <title>ClientDependency now supporting MVC</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;I’m please to announce that the ClientDependency framework now supports MVC! It’s very easy to implement using HtmlHelper extension methods. Here’s some quick examples:  &lt;p&gt;Make a view dependent on a CSS file based on a path defined as “Styles”&lt;/p&gt;&lt;pre&gt;&amp;lt;% Html.RequiresCss("Content.css", "Styles"); %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Make a view dependent on jQuery using a full path declaration:&lt;/p&gt;&lt;pre&gt;&amp;lt;% Html.RequiresJs("/Js/jquery-1.3.2.min.js"); %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Rendering the Style blocks and defining a global style path:&lt;/p&gt;&lt;pre&gt;&amp;lt;%= Html.RenderCssHere(new BasicPath("Styles", "/Css")) %&amp;gt;&lt;/pre&gt;
&lt;p&gt;Rendering the Script block (no global script path defined):&lt;/p&gt;&lt;pre&gt;&amp;lt;%= Html.RenderJsHere() %&amp;gt;&lt;/pre&gt;
&lt;p&gt;There’s still a provider model for MVC but it uses a slightly different implementation from Web Forms. The same &lt;code&gt;compositeFiles&lt;/code&gt; provider model is used but instead of the &lt;code&gt;fileRegistration&lt;/code&gt; provider model that is used in Web Forms, a new mvc &lt;code&gt;renderers&lt;/code&gt; provider model is used. A renderer provider is similar to the Web Forms &lt;code&gt;fileRegistration&lt;/code&gt; providers but instead of registering the markup in the page using the page life cycle, a renderer provider is used to render out the html block necessary to embed in the page.&lt;/p&gt;
&lt;p&gt;All of the functionality that existed in Web Forms exists in MVC. You can make as many views that you want dependent on as many of the same or different client files that you want and the system will still sort by position and priority and remove all duplicate registrations. Rogue scripts &amp;amp; styles still get processed by the composite file provider in MVC. Currently however, if you place user or composite controls on your views that have Client Dependencies tagged with either the control or attribute method used in Web Forms, these will not be registered with the view and output with the renderer.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;MVC pages have been added to the demo project as examples so have a look! You can download the source &lt;a style="font-size: 16pt" href="http://clientdependency.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;HERE&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For full details and documentation go &lt;a style="font-size: 16pt" href="http://clientdependency.codeplex.com/" target="_blank"&gt;HERE&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1209</guid>
      <link>https://shazwazza.com/post/umbraco-41-benchmarks-part-1-do-over/</link>
      <category>Umbraco</category>
      <title>Umbraco 4.1 Benchmarks Part 1 (Do Over)</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;Doh! Turns out that my first &lt;a href="http://farmcode.org/post/2010/04/15/Umbraco-41-Benchmarks-Part-1.aspx" target="_blank"&gt;Umbraco 4.1 benchmarks&lt;/a&gt; was done on a build of 4.1 that had a couple of bugs in it :( BUT, this turns out to be even better for 4.1 that I previously thought! (plus there’s bugs fixed now :) If you didn’t read the last post, i recommend that you do as it has some insight as to how these stats came to be.  &lt;p&gt;So, without further adieu, here’s the (true) new results:&lt;/p&gt; &lt;style&gt;


































.stats th {background-color:#ffffcc;color:black;}
.stats td, .stats th {
border-top:solid 1px black;
border-right:solid 1px black;
border-top:solid 1px black;
}
.stats td.first, .stats th.first {
border-left:solid 1px black;
}
.stats tr.bottom td, .stats td.bottom {
border-bottom:solid 1px black;
}
.stats tr.one { background-color:#ededed;}
.stats tr.two { background-color:#dcdcdc;}
.stats tr.three { background-color:#ededed;}
.stats tr.four {background-color:#d6f5f5;}&lt;/style&gt;  &lt;table class="stats" cellspacing="0" cellpadding="2" width="623"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th class="first" valign="top" width="110"&gt;Test&lt;/th&gt; &lt;th valign="top" width="168"&gt;Stats&lt;/th&gt; &lt;th valign="top" width="68"&gt;4.0.3&lt;/th&gt; &lt;th valign="top" width="107"&gt;4.0.3 &lt;br&gt;client cached&lt;/th&gt; &lt;th valign="top" width="69"&gt;4.1&lt;/th&gt; &lt;th valign="top" width="99"&gt;4.1 &lt;br&gt;client cached&lt;/th&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Content app&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;68&lt;/td&gt; &lt;td valign="top" width="107"&gt;7&lt;/td&gt; &lt;td valign="top" width="69"&gt;45&lt;/td&gt; &lt;td valign="top" width="99"&gt;5&lt;/td&gt;&lt;/tr&gt; &lt;tr class="one"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;687.05&lt;/td&gt; &lt;td valign="top" width="107"&gt;72.48&lt;/td&gt; &lt;td valign="top" width="69"&gt;382.42&lt;/td&gt; &lt;td valign="top" width="99"&gt;11.61&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Edit content &lt;br&gt;home page&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;50&lt;/td&gt; &lt;td valign="top" width="107"&gt;2&lt;/td&gt; &lt;td valign="top" width="69"&gt;34&lt;/td&gt; &lt;td valign="top" width="99"&gt;1&lt;/td&gt;&lt;/tr&gt; &lt;tr class="two"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;385.10&lt;/td&gt; &lt;td valign="top" width="107"&gt;47.28&lt;/td&gt; &lt;td valign="top" width="69"&gt;335.02&lt;/td&gt; &lt;td valign="top" width="99"&gt;11.94&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td class="first" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;Expand all &lt;br&gt;content nodes&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;17&lt;/td&gt; &lt;td valign="top" width="107"&gt;17&lt;/td&gt; &lt;td valign="top" width="69"&gt;16&lt;/td&gt; &lt;td valign="top" width="99"&gt;16&lt;/td&gt;&lt;/tr&gt; &lt;tr class="three"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="107"&gt;18.47&lt;/td&gt; &lt;td valign="top" width="69"&gt;13.96&lt;/td&gt; &lt;td valign="top" width="99"&gt;7.54&lt;/td&gt;&lt;/tr&gt; &lt;tr class="four"&gt; &lt;td class="first bottom" valign="top" rowspan="2" width="110"&gt;&lt;strong&gt;TOTALS&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="168"&gt;Completed Requests&lt;/td&gt; &lt;td valign="top" width="68"&gt;135&lt;/td&gt; &lt;td valign="top" width="107"&gt;26&lt;/td&gt; &lt;td valign="top" width="69"&gt;95&lt;/td&gt; &lt;td valign="top" width="99"&gt;22&lt;/td&gt;&lt;/tr&gt; &lt;tr class="bottom four"&gt; &lt;td valign="top" width="168"&gt;Response (KB)&lt;/td&gt; &lt;td valign="top" width="68"&gt;1063.62&lt;/td&gt; &lt;td valign="top" width="107"&gt;138.23&lt;/td&gt; &lt;td valign="top" width="69"&gt;731.40&lt;/td&gt; &lt;td valign="top" width="99"&gt;31.09&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;So to recap, here’s the total average savings in 4.1&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Without client cache (First run)  &lt;ul&gt; &lt;li&gt;Number of completed requests: &lt;strong&gt;30% Less&lt;/strong&gt;  &lt;li&gt;Response bandwidth: &lt;strong&gt;31% Less&lt;/strong&gt; &lt;/li&gt;&lt;/ul&gt; &lt;li&gt;With client cache  &lt;ul&gt; &lt;li&gt;Number of completed requests: &lt;strong&gt;6% Less&lt;/strong&gt;  &lt;li&gt;Response bandwidth: &lt;strong&gt;78% Less&lt;/strong&gt; &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1237</guid>
      <link>https://shazwazza.com/post/aspnet-client-dependency-framework-rc1-released/</link>
      <category>Client Dependency</category>
      <title>ASP.Net Client Dependency Framework RC1 Released!</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;With the community feedback, bug reports, patches, etc… I’ve managed to find time to upgrade this library to a release candidate status. We do use this framework in many production websites but it was great to hear from other in regards to specific bugs that were found relating to particular environments. These bugs have all been fixed up and this library is looking very stable. &lt;/p&gt;  &lt;p&gt;You can download the binaries &lt;a href="http://clientdependency.codeplex.com/releases/view/42193" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Better yet, I’ve put together a near complete documentation library on CodePlex &lt;a href="http://clientdependency.codeplex.com/documentation" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here&lt;/strong&gt;&lt;/a&gt; !!&lt;/p&gt;  &lt;p&gt;I still think the best way to learn about this project is to download the source code from CodePlex &lt;a href="http://clientdependency.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;&lt;strong style="font-size: 22px"&gt;here &lt;/strong&gt;&lt;/a&gt;and have a look at the demo web application included.&lt;/p&gt;  &lt;p&gt;Moving forward, the next phase for this library is to add MVC support and another file registration provider called PlaceholderProvider which will give you even more granular control over where dependencies can be rendered in your markup. MVC support should be fairly straight forward and we’ll include a demo project for this as well.&lt;/p&gt;  &lt;p&gt;Well definitely be releasing a final version soon after the next Umbraco 4.1 release candidate is released (which will hopefully be fairly soon!)&lt;/p&gt;  &lt;p&gt;Happy day! Any and all feedback, bug reports and patches are definitely appreciated!&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1255</guid>
      <link>https://shazwazza.com/post/adding-embedded-resource-with-clientdependency/</link>
      <category>Umbraco</category>
      <category>Client Dependency</category>
      <title>Adding embedded resource with ClientDependency</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;The &lt;a href="http://ucomponents.codeplex.com/"&gt;uComponents&lt;/a&gt; project for &lt;a href="http://umbraco.org" target="_blank"&gt;Umbraco&lt;/a&gt; is coming along rather nicely! So far there are 13 new data types created and a few extensions, hopefully soon we’ll have a package ready to go. In the meantime, I thought I’d share a nice little code snippet that we’re using this throughout uComponents that allows you to add embedded resources to &lt;a href="http://clientdependency.codeplex.com" target="_blank"&gt;ClientDependency&lt;/a&gt;. It’s pretty easy and works perfectly with Umbraco 4.5 or any other site you have running ClientDependency. This will ensure that embedded resources (JavaScript or CSS) are added to the ClientDependency combined scripts/styles and also compressed and cached.   &lt;p&gt;First, I’ll show you how to register your embedded resources using our extension method class (for a &lt;em&gt;Control &lt;/em&gt;object):&lt;/p&gt;&lt;pre&gt;this.AddResourceToClientDependency(
    "DataTypesForUmbraco.Controls.Shared.Resources.PrevalueEditor.css", 
    ClientDependency.Core.ClientDependencyType.Css);&lt;/pre&gt;
&lt;p&gt;The above code assumes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The class that you are consuming the code inherits from &lt;em&gt;System.Web.UI.Control&lt;/em&gt; 
&lt;li&gt;That your embedded resource’s path is: &lt;em&gt;DataTypesForUmbraco.Controls.Shared.Resources.PrevalueEditor.css&lt;/em&gt; 
&lt;ul&gt;
&lt;li&gt;If you don’t know about embedded resources, or know how they work, you should read: &lt;a href="http://support.microsoft.com/kb/910442" target="_blank"&gt;Working With Embedded Resources in ASP.Net&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;That your embedded resource is a CSS type &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Pretty easy right!! Well, the only thing missing is that you’ll need to add our extension method class to your project which looks like this:&lt;/p&gt;&lt;pre&gt;/// &lt;summary&gt;
/// Extension methods for embedded resources
/// &lt;/summary&gt;
public static class ResourceExtensions
{

    /// &lt;summary&gt;
    /// Adds an embedded resource to the ClientDependency output by name
    /// &lt;/summary&gt;
    /// &lt;param name="ctl" /&gt;&lt;/param&gt;
    /// &lt;param name="resourceName" /&gt;&lt;/param&gt;
    /// &lt;param name="type" /&gt;&lt;/param&gt;
    public static void AddResourceToClientDependency(this Control ctl, string resourceName, ClientDependencyType type)
    {
        //get the urls for the embedded resources           
        var resourceUrl = ctl.Page.ClientScript.GetWebResourceUrl(ctl.GetType(), resourceName);

        //add the resources to client dependency
        ClientDependencyLoader.Instance.RegisterDependency(resourceUrl, type);
    }

    /// &lt;summary&gt;
    /// Adds an embedded resource to the ClientDependency output by name and priority
    /// &lt;/summary&gt;
    /// &lt;param name="ctl" /&gt;&lt;/param&gt;
    /// &lt;param name="resourceName" /&gt;&lt;/param&gt;
    /// &lt;param name="type" /&gt;&lt;/param&gt;
    public static void AddResourceToClientDependency(this Control ctl, string resourceName, ClientDependencyType type, int priority)
    {
        //get the urls for the embedded resources           
        var resourceUrl = ctl.Page.ClientScript.GetWebResourceUrl(ctl.GetType(), resourceName);

        //add the resources to client dependency
        ClientDependencyLoader.Instance.RegisterDependency(priority, resourceUrl, type);
    }

}&lt;/pre&gt;
&lt;p&gt;So basically, if you have a &lt;em&gt;Control, &lt;/em&gt;you can register your embedded resources in ClientDependency with one line of code… sweeeeet.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:13 Z</pubDate>
      <a10:updated>2023-03-23T15:08:13Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1321</guid>
      <link>https://shazwazza.com/post/virtualpathutility-fixed-in-net-4/</link>
      <category>Web Development</category>
      <title>VirtualPathUtility Fixed in .Net 4</title>
      <description>&lt;p&gt;If you are not already aware there’s an issue with the &lt;a title="VirtualPathUtility" href="http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx" target="_blank"&gt;VirtualPathUtility&lt;/a&gt; object in the .Net framework. If you are trying to use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.isabsolute.aspx" target="_blank"&gt;IsAbsolute&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.toabsolute.aspx" target="_blank"&gt;ToAbsolute&lt;/a&gt; methods with a path that contains a query string, you’ll get an exception thrown. A quick Google search on this issue will show you a ton of posts and ‘work arounds’ for this problem and I’ve implemented a custom work around for this in the &lt;a title="ClientDependency" href="http://clientdependency.codeplex.com" target="_blank"&gt;ClientDependency&lt;/a&gt; framework as well. In fact, I only noticed this problem when testing the ClientDependency framework with .Net 3.5 and trying to register embedded resources through it (as see in this blog post &lt;a title="Registering web resources via ClientDependency" href="http://www.farmcode.org/post/2010/08/03/Adding-embedded-resource-with-ClientDependency.aspx" target="_blank"&gt;here&lt;/a&gt;). Since I’d been developing the latest builds of ClientDependency in .Net 4, i had no problems at all but as soon as I changed the build to .Net 3.5, the exceptions began to show since web resource URLs have query strings. &lt;/p&gt;  &lt;p&gt;So it the good new is that it appears as though Microsoft have finally fixed this bug in .Net 4! The bad news is that you’ll still have to use your ‘work arounds’ if you are targeting framework versions below 4.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:09 Z</pubDate>
      <a10:updated>2023-03-23T15:08:09Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1235</guid>
      <link>https://shazwazza.com/post/multi-targeting-a-single-net-project-to-build-for-different-framework-versions/</link>
      <category>ASP.Net</category>
      <title>Multi targeting a single .Net project to build for different framework versions</title>
      <description>&lt;p&gt;Consider this scenario:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I have a project that relies on ASP.Net MVC and currently this project is built against the .Net framework 4.0 and MVC 4&lt;/li&gt;
&lt;li&gt;I want to support MVC 5 for this project&lt;/li&gt;
&lt;li&gt;To support MVC 5, I’d need to upgrade the project to use .Net framework 4.5&lt;/li&gt;
&lt;li&gt;This would mean that developers still running .Net framework 4.0 would no longer be able to use my updated project&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also don’t want to have to create different projects and assemblies that target specific MVC versions &lt;em&gt;(in this case you’d end up with assembly names like MyProject.MVC4.dll and MyProject.MVC5.dll)&lt;/em&gt;. I have seen this done with other solutions and it works but I feel it is not necessary unless your project is using specific functionality from a particular MVC version.&lt;/p&gt;
&lt;p&gt;In my case my project will compile perfectly against MVC 4 and 5 without any codebase changes so I’m not actually targeting against a specific MVC version ( &amp;gt;= 4 ). If your project uses specific functionality from the different MVC versions I think you will have to output different assemblies like MyProject.MVC5.dll. In that case this post will probably help: &lt;a href="http://blogs.korzh.com/2013/12/nuget-package-different-mvc-versions.html" title="http://blogs.korzh.com/2013/12/nuget-package-different-mvc-versions.html"&gt;http://blogs.korzh.com/2013/12/nuget-package-different-mvc-versions.html&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The goal&lt;/h2&gt;
&lt;p&gt;The end result is that I want a single project file that has 4 build configurations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Debug&lt;/strong&gt; / &lt;strong&gt;Release&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;These will build against .Net 4.0&lt;/li&gt;
&lt;li&gt;This will reference MVC 4&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debug-Net45&lt;/strong&gt; / &lt;strong&gt;Release-Net45&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;This will build against .Net 4.5&lt;/li&gt;
&lt;li&gt;This will reference MVC 5&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each of these build configurations exports the same assembly name: &lt;em&gt;MyProject.dll&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I then want a single NuGet package which will install the correct DLL based on the .Net version that the user has installed.&lt;/p&gt;
&lt;h2&gt;How it’s done&lt;/h2&gt;
&lt;h3&gt;Build configuration setup&lt;/h3&gt;
&lt;p&gt;To start with you’ll have a project that targets .Net framework 4.0 and references MVC 4 and 2 standard build configurations: &lt;em&gt;Debug, Release&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;First we need to create 2 new build configurations: &lt;em&gt;Debug-Net45 &lt;/em&gt;and &lt;em&gt;Release-Net45 &lt;/em&gt;and have these configurations output the DLLs to a custom folder. To do this we launch the Configuration Manager:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-04-30_2014.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-04-30_2014_thumb.png" border="0" alt="2014-04-30_2014" title="2014-04-30_2014" width="244" height="119" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Create a new build configuration:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-04-30_2016.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-04-30_2016_thumb.png" border="0" alt="2014-04-30_2016" title="2014-04-30_2016" width="244" height="103" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enter the name of the new configuration and copy the configuration from it’s associated existing one. So &lt;em&gt;Debug-Net45&lt;/em&gt; would copy from &lt;em&gt;Debug&lt;/em&gt; and &lt;em&gt;Release-Net45&lt;/em&gt; copies from &lt;em&gt;Release&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-04-30_2021.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-04-30_2021_thumb.png" border="0" alt="2014-04-30_2021" title="2014-04-30_2021" width="244" height="130" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;ul&gt;&lt;!--EndFragment--&gt;&lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;Do this for both configurations – &lt;em&gt;Debug-Net45&lt;/em&gt; and &lt;em&gt;Release-Net45&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;Project setup&lt;/h3&gt;
&lt;p&gt;The next step requires manually editing your .csproj file since Visual Studio doesn’t want to normally allow you to do this. This is how you can configure each build type to target a different framework version. You’ll first need to find these 2 entries:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt; &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt; &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Inside each of these elements you need to explicitly tell these build configurations to use .Net framework 4.0 by adding this element:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;v4.0&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Next you’ll want to copy/paste both of these property groups and:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change the &lt;em&gt;Condition&lt;/em&gt; to check for the new build configurations and to target .Net framework 4.5&lt;/li&gt;
&lt;li&gt;Change the &lt;em&gt;OutputPath&lt;/em&gt; to have a specific .Net 4.5 folder&lt;/li&gt;
&lt;li&gt;Change the &lt;span class="html"&gt;&lt;em&gt;TargetFrameworkVersion &lt;/em&gt;to be .Net 4.5&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You should end up with 2 new elements that look something like:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt; &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;="'$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU'"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DebugSymbols&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;true&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DebugSymbols&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutputPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;bin\Debug-Net45\&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;OutputPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DefineConstants&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;DEBUG;TRACE&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DefineConstants&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DebugType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;full&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DebugType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;AnyCPU&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ErrorReport&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;prompt&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ErrorReport&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;v4.5&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;AnyCPU&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt; &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;="'$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU'"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DebugType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;pdbonly&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DebugType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Optimize&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;true&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Optimize&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;OutputPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;bin\Release-Net45\&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;OutputPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DefineConstants&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;TRACE&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DefineConstants&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ErrorReport&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;prompt&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ErrorReport&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;WarningLevel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;4&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;WarningLevel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;v4.5&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TargetFrameworkVersion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;AnyCPU&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;PlatformTarget&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Next we need to do this for the MVC references or any framework specific references you need to target. In this example it is just the MVC references and you’ll need to wrap them with an &lt;em&gt;ItemGroup&lt;/em&gt; element, you’ll end up with something like this to target the MVC 4 libs:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ItemGroup&lt;/span&gt; &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;=" '$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.Helpers, Version=2.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.Helpers.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.Mvc, Version=4.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.Razor, Version=2.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.Razor.2.0.30506.0\lib\net40\System.Web.Razor.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.WebPages, Version=2.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.WebPages.Deployment, Version=2.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Deployment.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.WebPages.Razor, Version=2.0.0.0, ....."&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;True&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Private&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        ..\packages\Microsoft.AspNet.WebPages.2.0.30506.0\lib\net40\System.Web.WebPages.Razor.dll
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HintPath&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Reference&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ItemGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then we need to go ahead and copy/paste this block but target the different build configurations and then swap out these MVC 4 version references with the MVC 5 version references.&lt;/p&gt;
&lt;h3&gt;Nuget package restore&lt;/h3&gt;
&lt;p&gt;For this tutorial I’m assuming you are using Nuget to reference your MVC libs and an easy way to get Nuget to play reasonably with this setup is to enable Nuget package restore for your solution – right click on your solution and click the button:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-05-01_1625.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-05-01_1625_thumb.png" border="0" alt="2014-05-01_1625" title="2014-05-01_1625" width="244" height="173" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then in your packages.config file you can manually add the MVC 5 references:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-8"&lt;/span&gt;?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;packages&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Mvc"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="4.0.30506.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net40"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Razor"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="2.0.30506.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net40"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.WebPages"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="2.0.30506.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net40"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.Web.Infrastructure"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0.0.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net40"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Mvc"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="5.0.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net45"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Razor"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="3.0.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net45"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;package&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.WebPages"&lt;/span&gt; 
           &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="3.0.0"&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net45"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;packages&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now when you build your solution under the different build configurations Nuget will automatically go and get the correct MVC versions based on the current .Net Framework version.&lt;/p&gt;
&lt;h2&gt;Thats it!&lt;/h2&gt;
&lt;p&gt;With all of this in place it should ‘just work’ :) You will notice some odd looking icons in your references list in Visual Studio but it’s nothing to worry about, Visual Studio is just confused because it isn’t familiar with how you’ve tricked it!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-05-01_1709.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-05-01_1709_thumb.png" border="0" alt="2014-05-01_1709" title="2014-05-01_1709" width="116" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So now when you build using your different build configurations, it will output the correct DLLs to the correct build folders:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Both &lt;em&gt;Debug &lt;/em&gt;&amp;amp; &lt;em&gt;Release &lt;/em&gt;will output to &lt;em&gt;/bin/Debug &lt;/em&gt;&amp;amp; &lt;em&gt;bin/Release &lt;/em&gt;with MVC 4 libraries and the MyProject.dll will be compiled against .Net Framework 4.0&lt;/li&gt;
&lt;li&gt;Both &lt;em&gt;Debug-Net45&lt;/em&gt; &amp;amp; &lt;em&gt;Release-Net45&lt;/em&gt; will be output to &lt;em&gt;/bin/Debug-Net45 &lt;/em&gt;&amp;amp; &lt;em&gt;/bin/Release-Net45 &lt;/em&gt;with MVC 5 libraries and the MyProject.dll will be compiled against .Net Framework 4.5&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And here’s some proof:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-05-01_1714.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-05-01_1714_thumb.png" border="0" alt="2014-05-01_1714" title="2014-05-01_1714" width="244" height="181" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate-import/2014-05-01_1715.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" src="https://shazwazza.com/media/articulate-import/2014-05-01_1715_thumb.png" border="0" alt="2014-05-01_1715" title="2014-05-01_1715" width="244" height="162" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you are using some automated build processes with MSBuild you can then just target the build configuration names you’d like to export.&lt;/p&gt;
&lt;p&gt;The Nuget setup is pretty simple since you can target your dependencies by framework:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;group&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net40"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="rem"&gt;&amp;lt;!--between 4 and less than version 5--&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;dependency&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Mvc"&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="(4.0.20710,5)"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;group&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;group&lt;/span&gt; &lt;span class="attr"&gt;targetFramework&lt;/span&gt;&lt;span class="kwrd"&gt;="net45"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="rem"&gt;&amp;lt;!--between 4 and less than version 6 (who knows what'll happen then)--&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;dependency&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Microsoft.AspNet.Mvc"&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="(4.0.20710,6)"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;group&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then for each of your lib files in Nuget you ensure that you output them to the framework specific /lib folders such as:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;target="lib\net40"&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;target="lib\net45"&lt;/pre&gt;
&lt;p&gt;This process has been implemented for the &lt;a href="https://github.com/Shandem/ClientDependency" target="_blank"&gt;Client Dependency Framework&lt;/a&gt; version &lt;a href="https://github.com/Shandem/ClientDependency/releases/tag/v1.8.0-beta" target="_blank"&gt;1.8.0&lt;/a&gt; to support MVC 4 and 5 without having to change the assembly name.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:08 Z</pubDate>
      <a10:updated>2023-03-23T15:08:08Z</a10:updated>
    </item>
  </channel>
</rss>