.NET Core Reference Type project not working
<p>I am having trouble with project reference and .NET Core.</p>

<p>I have a library (<code>MyLib</code>) in the src folder and two project in the test folder (<code>MyLib.Tests</code> and <code>MyLib.Tests.Support</code>)</p>

<p>Summarized:</p>

<pre><code>|-- global.json
|-- src
|   \-- MyLib
\-- test
    |-- MyLib.Tests
    \-- MyLib.Tests.Support
</code></pre>

<p>MyLib is already available through NuGet and the tests projects are not (and won't be).</p>

<p>When I reference (with the <code>right click &gt; add reference</code> option) <code>MyLibTest.Support</code> within <code>MyLib.Tests</code>, the <code>dotnet-restore</code> works fine. In visual studio, under "References", I have the small icon indicating it is a project reference. When I reference (still with the <code>right click &gt; add reference</code> option) <code>MyLib</code> within <code>MyLib.Tests</code>, the <code>dotnet-restore</code> works also fine but I have the small icon indicating it is a nuget reference.</p>

<p>It is the expected behaviour but I don't want my test project to test the "old" NuGet package but the actual code.</p>

<p>According to the documention and a lots of tutorial I found on the internet, I then configure in <code>MyLib.Tests\project.json</code> the <code>MyLib</code> dependency as a project dependency:</p>

<pre><code>{
  "dependencies": {
      "NETStandard.Library": "1.6.0",
      "SimpleDao": {
        "target": "project"
        "version": "2.0.0-*"
      },
      "MyLib.Tests.Support": "1.0.0-*"
  }
}
</code></pre>

<p>But then, the <code>dotnet-restore</code> fails: </p>

<ol>
<li>Visual Studio error: <code>NU1001 The dependency MyLib could not be resolved.</code></li>
<li>Console error: <code>Unable to resolve 'MyLib' for '.NETStandard,Version=v1.6'</code></li>
</ol>

<p>Here is my global.json:</p>

<pre><code>{
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}
</code></pre>

<p>Ask me for anything else that could be relevant to explain my troubles</p>

<p>Thanks in advance.
(Excuse me for my english, I am not a native speaker)</p>

<hr>

<p><strong>Edit:</strong></p>

<p>I realized there is also something wrong with my lib : actually <code>MyLib</code> is composed of three libs:</p>

<ol>
<li><code>MyLib</code>, mostly interfaces, targetting <code>.netstandard1.1</code></li>
<li><code>MyLib.Impl1</code>, first implementation, targetting <code>.net451</code> and <code>.netstandard1.3</code> (not yet on NuGet)</li>
<li><code>MyLib.Impl2</code>, second implementation, targetting <code>.net45</code> (there is already a first version of it on NuGet)</li>
</ol>

<p>Always with the same methodology for adding the reference (<code>right click &gt; add reference</code>). <strong>I did not edit the project.json files</strong> (both are adding the reference like this: "MyLib": "2.0.0-*").</p>

<p>In the first implementation, visual studio get the dependencies through NuGet (there is the NuGet icon in the references tab). And I do not have the lastest edit on the interfaces of MyLib.</p>

<p>In the second implementation, visual studio get the dependencies within the project (there is the project icon in the references tab), and I do have the lastest edit on the interfaces.</p>

<p>If I try to edit the project.json to configure the dependency to MyLib as a project dependency, I can not restore the package too, same error than for the tests...</p>

<p>Is it a bug in .NET Core (I am trying to restore with both Visual Studio and dotnet-cli) or am I doing Something wrong?</p>

<p><strong>Edit 3:</strong> I had published pre-release version of <code>MyLib</code> and <code>MyLib.Impl2</code> on NuGet. I deleted those version and get back to my solution. Now, <code>MyLib.Impl1</code> and <code>MyLib.Impl2</code> are targetting correctly my project reference (for <code>MyLib.Impl1</code> I had to specify the target in the project.json and not for <code>MyLib.Impl2</code>. I don't know why but at least it works now -_-).</p>

<p>But I still can't fix my test project. It still don't want to work with the project reference...</p>

<hr>

<p><strong>Edit 2:</strong></p>

<p><a href="https://github.com/fharr/SimpleDAO/tree/migration" rel="nofollow">Here</a> is my github repository where you can find my whole code (within the migration branch).</p>