Using shared libraries with .NET Core

I wrote my open source library, LINQ to Twitter , with shared libraries to minimize deployment artifacts and handle platform-specific features. I want to support .NET Core and I think that the fastest approach would be to access shared libraries. The Add Links dialog box did not display shared libraries, so I tried project.json:

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "LinqToTwitter.Shared": "*",
    "LinqToTwitter.Shared.net": "*"
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

I tried several combinations of versions, but received nothing. Error messages contain the following:

The LinqToTwitter.Shared> = * dependency cannot be resolved.

Then I opened * .xproj and inserted the following imports into the Project section:

<Import Project="..\LinqToTwitter.Shared\LinqToTwitter.Shared.projitems"
        Label="Shared" />
<Import 
  Project="..\LinqToTwitter.Shared.net\LinqToTwitter.Shared.net.projitems" 
  Label="Shared" />

VS, ( ) - , .NET.

+4
2

- Visual Studio 2017 .NET Core .

0

, , target:project -

{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "LinqToTwitter.Shared": {"target": "project"},
    "LinqToTwitter.Shared.net": {"target": "project"}
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}
0

All Articles