title: Cannot reference net45 version of Microsoft.Owin Nuget package
body: <p>So a couple of hours ago, I asked this question on SO: <a href="https://stackoverflow.com/questions/26154898/strange-microsoft-owin-dll-issue-and-nuget/26155474#26155474">Strange Microsoft.Owin DLL issue and Nuget</a></p>
  
  <p>I cleaned deleted some DLLs that were in the bin folder of my ASP.NET website and checked into source control. After this, I was getting an error running my website localhost:</p>
  
  <pre><code>could not load type 'Microsoft.Owin.Security.AuthenticationDescription' from assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
  </code></pre>
  
  <p>I figured out that my project is now referencing the 4.0 version of Microsoft.Owin, if I copy the 4.5 version of Microsoft.Owin into the bin directory of my ASP.NET MVC project, the error is fixed.</p>
  
  <p>So I need a reference to Microsoft.Owin in</p>
  
  <pre><code>\packages\Microsoft.Owin.2.1.0\lib\net45
  </code></pre>
  
  <p>Currently my project reference is to:</p>
  
  <pre><code>\packages\Microsoft.Owin.2.1.0\lib\net40
  </code></pre>
  
  <p>No matter how many times I delete the reference to the net40 Microsoft.Owin.dll, close the project, reopen it, clean it, and than try Adding a new reference and browsing to \packages\Microsoft.Owin.2.1.0\lib\net45, I still get a reference to net40 version.</p>
  
  <p>I have checked the packages.config:</p>
  
  <pre><code>  &lt;package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" /&gt;
  </code></pre>
  
  <p>The csproj file:</p>
  
  <pre><code>    &lt;Reference Include="Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;HintPath&gt;..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p>In my web.config:</p>
  
  <pre><code> &lt;compilation debug="true" targetFramework="4.5"&gt;
  </code></pre>
  
  <p>The Target framework for the project in the project properties is 4.5</p>
  
  <p>I have uninstalled and reinstalled the Microsoft.Owin 2.1.0 Nuget package.</p>
  
  <p>I even tried copying the net45 Microsoft.Owin.dll into the net40 folder for the package which resulted in the error:</p>
  
  <pre><code>Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  </code></pre>
  
  <p>I am using Visual Studio 2012 with tools for Visual Studio 2013 installed, when I open the Package Manage Console, I believe this is the version of Nuget I have: Package Manager Console Host Version 2.8.50313.31</p>
  
  <p><strong>If I copy the net45 version into the bin of my ASP.NET MVC Project, my error is fixed</strong></p>
  
  <p><strong>Where is the reference to Microsoft.Owin net40 in my packages.config, Web.config or csproj, its not there, everything points to net45 libs for my packages but Microsoft.Owin points to \packages\Microsoft.Owin.2.1.0\lib\net40 no matter what I do.</strong></p>