c# - Unable to restore a nuget of .net core class lib into another -
i trying create nuget class library want consumed across different applications. class library in .net core (4.5.1 framework).
the project.json looks below:
{ "version": "1.0.0", "dependencies": { "netstandard.library": "1.6.0", "microsoft.aspnetcore.diagnostics.abstractions": "1.0.0", "microsoft.aspnetcore.http": "1.0.0", "log4net": "2.0.8" }, "description": "logging .net core", "frameworks": { "netstandard1.6": { "imports": [ "dnxcore50" ] } } }
i build class library , create nuget package , put in internal repository. created nuget package using 2 different ways:
- create .nuspec file( command :
nuget spec
) , pack .nuspec file (commandnuget pack projectname.nuspec
) -> results in .nupkg file - command : dotnet pack project.json -> results in .nupkg , .sysmbols.nupkg files
when try restore package repo application, error : nuget created method 1 :
package testlib 1.0.0 not compatible netstandard1.6 (.netstandard,version=v1.6). package testlib 1.0.0 supports: net (.netframework,version=v0.0) 1 or more packages incompatible .netstandard,version=v1.6.
when looked references tree in solution explorer, see error on referenced class library package message :
nu1002 dependency testlib not support framework .netstandard, version =v1.6
for method 2:
restore successful, not get/use classes library. empty dll reference.
the project.json of application simple , straight.
{ "version": "1.0.0-*", "buildoptions": { "emitentrypoint": true }, "dependencies": { "microsoft.netcore.app": { "type": "platform", "version": "1.0.1" }, "testlib": "1.0.0" }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } } }
i going clue less why behaviour!! why not able restore .net core library nuget another. tried restoring . net core console application, .net core web application same results.
i using vs2015 enterprise edition .netcore tools preview 2
Comments
Post a Comment