Adding x86 and x64 libraries to NuGet package : <p>I have made a library which depends on CEFsharp which requires to build the library for specific platforms. So no AnyCPU support.</p>

<p>Now I want to pack this into a NuGet. As far as I understand you have to put these files into the build folder and have a <code>.targets</code> file which picks the correct dll to reference. So I ended up with a NuGet package looking like this:</p>

<pre><code>lib
    monodroid
        MyLib.dll
    xamarin.ios10
        MyLib.dll
    net45
        MyLib.dll (x86)
build
    net45
        x86
            MyLib.dll (x86)
        x64
            MyLib.dll (x64)
        MyLib.targets
</code></pre>

<p>I put the following inside of the <code>.targets</code> file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  &lt;Target Name="PlatformCheck" BeforeTargets="InjectReference"
    Condition="(('$(Platform)' != 'x86') AND  ('$(Platform)' != 'x64'))"&gt;
    &lt;Error  Text="$(MSBuildThisFileName) does not work correctly on '$(Platform)' platform. You need to specify platform (x86 or x64)." /&gt;
  &lt;/Target&gt;

  &lt;Target Name="InjectReference" BeforeTargets="ResolveAssemblyReferences"&gt;
    &lt;ItemGroup Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'x64'"&gt;
      &lt;Reference Include="MyLib"&gt;
        &lt;HintPath&gt;$(MSBuildThisFileDirectory)$(Platform)\MyLib.dll&lt;/HintPath&gt;
      &lt;/Reference&gt;
    &lt;/ItemGroup&gt;
  &lt;/Target&gt;
&lt;/Project&gt;
</code></pre>

<p>So far so good. Now to the problem. When adding this NuGet to a new WPF project, I see the reference to the library appearing in the <code>.csproj</code> file like:</p>

<pre><code>&lt;Reference Include="MyLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d64412599724c860, processorArchitecture=x86"&gt;
  &lt;HintPath&gt;..\packages\MyLib.0.0.1\lib\net45\MyLib.dll&lt;/HintPath&gt;
  &lt;Private&gt;True&lt;/Private&gt;
&lt;/Reference&gt;
</code></pre>

<p>Although I don't see anything mentioned about the <code>.targets</code> file. Is this still the way to do it with NuGet 3? Did I do something wrong? Currently this fails at runtime when running x64 because of the reference to the x86 lib.</p>
