It is well known that breaking a big solution is a few projects to the question of creating a code base, and this was easily done in early versions of the .NET Framework from within Visual Studio.
How can this be done with the .NET CLI? Suppose we have the following simplified scenario, for example:
- Solution Folder - global.json - src - LibProject - ConsoleProject
Suppose now that ConsoleProject dependent on LibProject . Intuitively, I suppose this means that the ConsoleProject in project.json should contain a dependencies section like this:
"dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }, "LibProject": "1.0.0-*" }
But if we do this when we try to restore the dependencies for ConsoleProject or when we try to build it, we cannot do it. When we try to recover, we get a message
Cannot resolve "LibProject (> = 1.0.0)" to ".NETCoreApp, Version = v1.0".
I understand the reason. When recovering, NuGet tries to find this as a package in the specified feeds on NuGet.config . But he should not do this, he should use the one that is in the sibling folder.
In previous versions of .NET Core, we added the link via VS, and then, if we tried to build ConsoleProject , VS first built LibProject and used the appropriate DLL.
How is the same done here? How do we refer to another project in the same solution and how can we restore / build / run with the .NET CLI with this dependency in mind?