title: Using reflection in net core packages targeting several frameworks
body: <p>I am developing a library(<code>nupkg</code>) in <em>.net core</em> targeting both <code>net45</code> and <code>netstandard1.3</code> and at some point I need to use reflection so my <code>project.json</code> looks like this:</p>
  
  <pre><code>{
    "version": "1.1.3",
    "dependencies": {
         common-dependencies
      }
    },
    "frameworks": {
      "net45": {
        "frameworkAssemblies": {
          "System.Reflection": "4.0.0.0"
        },
        "dependencies": {
          "NLog": "4.3.5",
          "Newtonsoft.Json": "6.0.4"
        }
      },
      "netstandard1.3": {
        "imports": "dnxcore50",
        "dependencies": {
          "NETStandard.Library": "1.6.0",
          "System.Reflection.TypeExtensions": "4.1.0",
          "Newtonsoft.Json": "8.0.2",
          "NLog": "4.4.0-*"
        }
      }
    }
  }
  </code></pre>
  
  <p>Most of the times after a mere <code>install-package my-package</code> everything works like a charm, however a couple of times I get this error on installing:</p>
  
  <blockquote>
    <p>install-package : Failed to add reference. The package 'my-Package' tried to add a framework reference to 'System.Reflection' which was not found in the GAC. This is possibly a bug in the 
    package. Please contact the package owners for assistance.</p>
  </blockquote>
  
  <p>I've found a workaround, which is to <code>uninstall-package</code> every other package on the project I want to install my package. This is very odd and undesired behavior I think. </p>
  
  <p>I do have noticed however that on some of those project had different versions of <code>Newtonsoft.Json</code> installed on different projects. This is a warning I also get when installation fails:</p>
  
  <blockquote>
    <p>Install failed. Rolling back...<br>
    Package 'my-package : Newtonsoft.Json [6.0.4, ), NLog [4.3.5, )' does not exist in project 'Target.Project'</p>
  </blockquote>
  
  <p>I have no idea what could be going on here, and the fact that it happens randomly and the workaround to fix it don't help much.</p>
  
  <p>Any ideas please?</p>