<?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">1234</guid>
      <link>https://shazwazza.com/post/how-i-configure-my-umbraco-cloud-website-to-support-nuget-packages/</link>
      <category>Umbraco</category>
      <title>How I configure my Umbraco Cloud website to support Nuget packages</title>
      <description>&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: &lt;em&gt;This post is about how I have my own website setup. This is based on my own personal opinions and is not meant to be an Umbraco Cloud ‘best practices’ guide. I’ve written this post since it might help others who have the same requirements as I do.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;My Requirements&lt;/h2&gt;
&lt;p&gt;For my simple website, I would like to manage all of my dependencies with Nuget, I don’t need anything compiled, don’t need class libraries and I don’t mind putting any required custom code into App_Code.&lt;/p&gt;
&lt;p&gt;Umbraco Cloud provisions a &lt;strong&gt;deployment&lt;/strong&gt; Git repository which for all intensive purposes is meant for deploying code between environments, not so much for a source code repository. That said, since my website is ultra simple and doesn’t contain any class library projects (etc…) I figured having an ASP.Net &lt;strong&gt;website&lt;/strong&gt; project configured in the Umbraco Cloud repository would be fine. A &lt;strong&gt;website&lt;/strong&gt; project is different from the standard &lt;strong&gt;web application&lt;/strong&gt; project; a website doesn’t compile, it runs &lt;em&gt;as-is&lt;/em&gt; which is suitable for the Umbraco Cloud Git repository since that’s exactly what the repository is made for: &lt;em&gt;to host a deployed website that runs based on the files as-is&lt;/em&gt;.  I prefer working with web application projects normally but in this case my website is ultra simple and a website project will work just fine plus this allows me to have a Visual Studio project/solution that works fairly seamlessly with Umbraco Cloud.&lt;/p&gt;
&lt;h2&gt;How to set this up&lt;/h2&gt;
&lt;p&gt;There’s not a lot required to set this up but there are a couple &lt;em&gt;‘gotchas’&lt;/em&gt;, here’s the steps:&lt;/p&gt;
&lt;h4&gt;1) Clone your Umbraco Cloud Git repo&lt;/h4&gt;
&lt;p&gt;The first step is straight forward, you need to clone your Umbraco Cloud Git repository to your local machine&lt;/p&gt;
&lt;h4&gt;2) Open your Umbraco Cloud site as a Website in Visual Studio&lt;/h4&gt;
&lt;p&gt;Open Visual Studio, &lt;em&gt;File –&amp;gt; Open –&amp;gt; Web site&lt;/em&gt; and choose the folder where your Umbraco Cloud site is cloned. This will open your Umbraco Cloud folder as a &lt;strong&gt;website&lt;/strong&gt; project (a&lt;em&gt;t this point you could ctrl+F5 and it would run your site). &lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;3) Save the sln file&lt;/h4&gt;
&lt;p&gt;You need to save the Visual Studio .sln file in order to have Nuget references, &lt;em&gt;File –&amp;gt; Save localhost_1234.sln As…&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This menu option is a bit odd and that’s because Visual Studio has created an in-memory .sln file which it’s auto-named to be localhost_PORT.sln&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_2.png"&gt;&lt;img style="display: inline; background-image: none;" src="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_thumb.png" border="0" alt="image" title="image" width="374" height="417" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you click on that, browse to your Umbraco Cloud Git repo folder and name the file something that makes more sense than localhost_PORT.sln.&lt;/p&gt;
&lt;h4&gt;4) Configure the Solution and Project to not build the website&lt;/h4&gt;
&lt;p&gt;This is optional but by default Visual Studio will try to build your website which means it’s going to try to precompile all views, etc… which not only can take some time but you will get false positive errors. So instead there’s 2 things to do: In Configuration Manager turn off the “Build” option for the website project and in the website project settings turn off building. Here’s how:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Build –&amp;gt; Configuration Manager&lt;/em&gt; opens a dialog, uncheck the Build checkbox for the website&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_4.png"&gt;&lt;img style="display: inline; background-image: none;" src="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_thumb_1.png" border="0" alt="image" title="image" width="534" height="220" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then right click the root of your website project and choose “Property Pages” and click on the “Build” navigation element. Then change the “Start action” to “No build” and un-check the “Build website as part of solution” checkbox&lt;/p&gt;
&lt;p&gt;&lt;a href="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_6.png"&gt;&lt;img style="display: inline; background-image: none;" src="https://shazwazza.com/media/articulate/open-live-writer-how-i-configure-my-umbraco-cloud-website_af45-image_thumb_2.png" border="0" alt="image" title="image" width="674" height="431" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;5) Create a Kudu .deployment file&lt;/h4&gt;
&lt;p&gt;Here’s one of the &lt;em&gt;‘gotchas’&lt;/em&gt;. Like Azure web apps, Umbraco Cloud also uses Kudu to perform some of it’s operations such as deploying a website from the Git repository to the hosting directory on the server. By default Kudu will copy the files in the deployment repository as-is to the hosting directory on the server &lt;em&gt;(which is what we want)&lt;/em&gt;… that is until Kudu sees things like &lt;em&gt;.sln &lt;/em&gt;or &lt;em&gt;.csproj &lt;/em&gt;files in the root of the Git repository, then it tries to be clever and build things &lt;em&gt;(which we don’t want).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So to tell Kudu to just deploy the files as-is, we create a special Kudu file at the repository root called &lt;em&gt;.deployment (to be clear this file name starts with a dot!)&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To create this, in your Visual Studio website project, right click the root click &lt;em&gt;Add –&amp;gt; Add new item –&amp;gt; Choose Text File –&amp;gt; Enter the name .deployment  &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then add the following to this file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[config]
project = .&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and this tells Kudu to just deploy the files that are found in the repo.&lt;/p&gt;
&lt;h4&gt;6) Now you can add Nuget references&lt;/h4&gt;
&lt;p&gt;Once all of this is setup, you can add Nuget references to this website project like you would normally add Nuget references. At this point you might need to make a choice: Do you want to manage your Umbraco installation based on Nuget? In some cases you might not have a choice if you need to reference a Nuget package that has a dependency on Umbraco.Core. &lt;/p&gt;
&lt;p&gt;As it turns out this choice isn’t such a big deal but some things to be aware of. Since Umbraco Cloud auto-upgrades projects to the latest patch version, you might be concerned that your packages.config is going to get out of date… luckily Umbraco Cloud is clever and will auto-update this file to the version it just upgraded you too. This also goes for minor version upgrades that you perform on Umbraco Cloud. Since Umbraco Cloud auto-commits all of the upgraded files, it means you really don’t have to do anything.&lt;/p&gt;
&lt;h4&gt;7) You’ll need to commit the special *.dll.refresh files&lt;/h4&gt;
&lt;p&gt;Once you start using Nuget with a website project, you’ll notice a bunch of these *.dll.refresh files in your /bin directory. You’ll need to commit those. These are special marker files used by Visual Studio to know how to manage Nuget dependencies with a website project.&lt;/p&gt;
&lt;h2&gt;That's it!&lt;/h2&gt;
&lt;p&gt;The above setup is an easy way to setup a Visual Studio solution with a single website project that works seamlessly with Umbraco Cloud while allowing you to manage dependencies with Nuget.&lt;/p&gt;
&lt;p&gt;But what if your solution is more complicated or you want to add class libraries, etc… ? There’s Umbraco documentation on how to configure this found here: &lt;a href="https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Visual-Studio/" title="https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Visual-Studio/"&gt;https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Visual-Studio/&lt;/a&gt;, &lt;a href="https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Working-With-Visual-Studio/" title="https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Working-With-Visual-Studio/"&gt;https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Working-With-Visual-Studio/&lt;/a&gt;  and the configuration there isn’t so different than the above except that the .sln file isn’t committed to the Umbraco Cloud Git deployment repository and instead exists in your own Git repository which in that case, the special &lt;em&gt;.deployment&lt;/em&gt; file is not necessary.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:09:00 Z</pubDate>
      <a10:updated>2023-03-23T15:09:00Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1323</guid>
      <link>https://shazwazza.com/post/using-an-iphone-with-the-visual-studio-development-server-charles/</link>
      <category>Web Development</category>
      <title>Using an iPhone with the Visual Studio development server &amp; Charles</title>
      <description>&lt;p&gt;&lt;a href="http://encosia.com"&gt;Dave Ward&lt;/a&gt; did a good post recently on how to use the &lt;a href="http://encosia.com/2010/06/10/using-an-iphone-with-the-visual-studio-development-server/"&gt;Visual Studio development server from a mobile devise such as an iPhone&lt;/a&gt;. But there’s a problem for us here, we use &lt;a href="http://www.charlesproxy.com/"&gt;Charles&lt;/a&gt; which I have found to be a better than Fiddler (it’s also cross-platform so I can use it both on my Mac and Windows machines).&lt;/p&gt; &lt;p&gt;So after reading Dave’s post I decided to have a look at how to do it if you’re using Charles, and well it’s pretty darn simple.&lt;/p&gt; &lt;p&gt;I’d suggest that you read Dave’s post first as I’m going to assume that you have, I’m just going to point out what you need to do different for Charles.&lt;/p&gt; &lt;h2&gt;Charles Configuration&lt;/h2&gt; &lt;p&gt;The first thing you need to do is find out on what port Charles is running on, by default Charles is on port &lt;strong&gt;8888&lt;/strong&gt;, but you can find the settings under &lt;em&gt;Proxy &amp;gt; Proxy Settings&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="/image.axd?picture=charles-proxy-config.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="charles-proxy-config" border="0" alt="charles-proxy-config" src="/image.axd?picture=charles-proxy-config_thumb.png" width="573" height="531"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Next we need to configure the external access to the HTTP Proxy that Charles is running. This is something that Charles handles differently to Fiddler, it’s actually a lot more configurable as you can define individual IP’s or IP ranges for access.&lt;/p&gt; &lt;p&gt;To do this you need to navigate to &lt;em&gt;Proxy &amp;gt; Access Control Settings&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="/image.axd?picture=charles-access-control.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="charles-access-control" border="0" alt="charles-access-control" src="/image.axd?picture=charles-access-control_thumb.png" width="559" height="517"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Then you just need to click &lt;strong&gt;Add&lt;/strong&gt; and enter the IP (or range) which you want to allow access to. I’ve just allowed access to the IP of my iPhone, which is &lt;strong&gt;192.168.1.44&lt;/strong&gt;. &lt;/p&gt; &lt;h2&gt;&lt;/h2&gt;  &lt;h2&gt;Conclusion&lt;/h2&gt; &lt;p&gt;The rest of Dave’s post is all you need to get this working, you connect to your computer from your external device in just the same way.&lt;/p&gt; &lt;p&gt;Hopefully this helps you out if you’re not a Fiddler user but want to be able to use a mobile device with Visual Studio’s development server.&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">1265</guid>
      <link>https://shazwazza.com/post/creating-code-behind-files-for-umbraco-templates/</link>
      <category>Umbraco</category>
      <title>Creating code-behind files for Umbraco templates</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 always had this idea in my head that one of the downfalls of using Umbraco when coming form standard ASP.Net web application was the missing code-behind files. You know, when you create a new web application and add an .aspx page to it it conveniently comes with a .cs and design.cs file. Most of the time I would even let the code-behind file inherit from my own custom Page/MasterPage implementation, e.g. a SecuredPage that comes with various properties and methods to handle authentication. Although Umbraco uses regular masterpages (if you haven’t turned it off in the web.config) all you get in the backoffice is the actual page template. Now, don’t get me wrong: I love the way Umbraco let’s you edit all aspects of your site via the backend and gives you the utmost flexibility and 100% control over the output, presented in a refreshingly simple manner. Yet sometimes you need a bit more, and it’s just another clear plus for Umbraco that you are able do the following without ever having to modify the core.  &lt;p&gt;The 'aha' moment that it is actually quite easy to add code-behind files to Umbraco masterpages came to me when I had to port a quite big ASP.Net website to Umbraco. The website had grown organically over the years with lots of custom templates, user controls, etc. The site also had multi-language support, all of which was handled in the code-behind files of the pages. The goal was to get it over to Umbraco as quick as possible, then rework the functionality bit by bit. So I started by creating a new Umbraco site and ‘wrapped’ it in a web application project in Visual Studio.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="/image.axd?picture=1-28-2011%205-00-55%20PM.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="1-28-2011 5-00-55 PM" border="0" alt="1-28-2011 5-00-55 PM" src="/image.axd?picture=1-28-2011%205-00-55%20PM_thumb.png" width="343" height="459"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;sub&gt;[Please refer to the comments below to find more information on how to set this up in Visual Studio.]&lt;/sub&gt;&lt;/p&gt; &lt;p&gt;After adding a couple of document types and templates in Umbraco the masterpages folder looks something like this:&lt;/p&gt; &lt;p&gt;&lt;a href="/image.axd?picture=1-28-2011%205-28-34%20PM.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="1-28-2011 5-28-34 PM" border="0" alt="1-28-2011 5-28-34 PM" src="/image.axd?picture=1-28-2011%205-28-34%20PM_thumb.png" width="153" height="77"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The Root.master file is the main master page, Page1.master and Page2.master are nested master pages in Umbraco. I’ve included all three of them in the solution. Now it’s time to create the code-behind file: right-click on the masterpages folder and add three C# classes and name them Root.master.cs, Page1.master.cs and Page2.master.cs. The result should be something like this:&lt;/p&gt; &lt;p&gt;&lt;a href="/image.axd?picture=1-28-2011%205-29-38%20PM.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="1-28-2011 5-29-38 PM" border="0" alt="1-28-2011 5-29-38 PM" src="/image.axd?picture=1-28-2011%205-29-38%20PM_thumb.png" width="191" height="127"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Visual Studio automatically groups them together, fantastic. Yet they are not really hooked up yet, VS does the grouping just based on file names. The master directive on Root.master currently looks like this:&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:4893245a-de6a-4304-b18c-29fdcf6764e1" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 592px; height: 65px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;%@ Master &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Language&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C#"&lt;/span&gt;&lt;span style="color: #ff0000"&gt; 
           MasterPageFile&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="~/umbraco/masterpages/default.master"&lt;/span&gt;&lt;span style="color: #ff0000"&gt; 
           AutoEventWireup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="true"&lt;/span&gt;&lt;span style="color: #ff0000"&gt; %&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;To hook up the cs file we need to add the CodeBehind and Inherits attributes like so:&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:367d06de-6e44-4624-bec8-3a56496ae9d8" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 587px; height: 93px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: #000000"&gt;@ Master Language&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;C#&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; 
           MasterPageFile&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;~/umbraco/masterpages/default.master&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; 
           AutoEventWireup&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;true&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; 
           CodeBehind&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;Root.master.cs&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt; 
           Inherits&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;Umbraco_4._6._1.masterpages.Root&lt;/span&gt;&lt;span style="color: #000000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;%&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;You should get an error at this point as the compiler complains that Root is not convertible to System.Web.UI.MasterPage, so we need to fix this in the cs file as well by making the class partial (necessary if you want to later add designer files as well) and inheriting from System.Web.UI.MasterPage. An empty Page_Load message can’t hurt as well:&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:d5afca84-faa0-4ffe-b389-afa876d28643" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 543px; height: 221px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;&lt;span style="color: #000000"&gt; System;

&lt;/span&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt;&lt;span style="color: #000000"&gt; Umbraco4_6_1.masterpages
{
    &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;partial&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;class&lt;/span&gt;&lt;span style="color: #000000"&gt; Root : System.Web.UI.MasterPage
    {
        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt; Page_Load(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&lt;span style="color: #000000"&gt; sender, EventArgs e)
        {
        }
    }
}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;You should now be able to switch between both files by pressing F7 in Visual Studio. Let’s try to add a Property and reference that from the template:&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:145b4492-011f-40ea-800f-d14449f9c0d9" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 580px; height: 176px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000"&gt;        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&lt;span style="color: #000000"&gt; Message { &lt;/span&gt;&lt;span style="color: #0000ff"&gt;get&lt;/span&gt;&lt;span style="color: #000000"&gt;; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;set&lt;/span&gt;&lt;span style="color: #000000"&gt;; }

        &lt;/span&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt; Page_Load(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&lt;span style="color: #000000"&gt; sender, EventArgs e)
        {
            Message &lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;All the best from your code-behind file!! :)&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;;
        }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;and something like this on the template:&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:c70b7ac6-b7f3-48d9-b7d8-5d5cda84ab99" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 367px; height: 70px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #000000"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;div&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;
        &amp;lt;%= Message %&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #0000ff"&gt;div&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;Now we just need to compile the project and navigate to a content page that uses the Root template to see the message.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Adding designer files&lt;/h3&gt;
&lt;p&gt;[As Simon Dingley pointed out below there is an even easier way to create the designer files: right-click on the master.aspx page and select "Convert to web application", which will create the .designer file for the selected item.]&lt;/p&gt;
&lt;p&gt;We can also add a designer file to the duo to make things even better. After adding Root.master.designer.cs, Page1.master.designer.cs and Page2.master.designer.cs the solution looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="/image.axd?picture=1-28-2011%205-49-22%20PM.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="1-28-2011 5-49-22 PM" border="0" alt="1-28-2011 5-49-22 PM" src="/image.axd?picture=1-28-2011%205-49-22%20PM_thumb.png" width="238" height="187"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Visual Studio is now rightfully complaining that it got duplicate definitions for the classes and even suggests to add the partial keyword, which we will quickly do. After that is all working and compiling nicely we need to give Visual Studio control over the designer files. That is easily accomplished by slightly modifying each .master file (e.g. by adding a single space to an empty line) and saving it, VS will do the rest for you. The most important thing this will do for you is to reference all controls you add to the template so they are available for use in the code-behind file.&lt;/p&gt;
&lt;p&gt;Now let’s try to modify the message value from the code-behind of Page1 by adding&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:63c8b174-c1eb-4519-94b9-ea292fac35ee" class="wlWriterSmartContent"&gt;&lt;pre style="background-color: white; width: 546px; height: 90px; overflow: auto"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt; Page_Load(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&lt;span style="color: #000000"&gt; sender, EventArgs e)
        {
            ((Root) Master).Message &lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt; &lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;Hello from the nested master page!&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;;
        }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
&lt;p&gt;to it. Browsing to any Umbraco page that uses the Page1 template will now show the new message.&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>