c# - How do I make a nuget package target multiple frameworks correctly? -


currently, following error:

could not install package 'csharp-extensions 1.2.0'. trying install package project targets '.netframework,version=v4.6', package not contain assembly references or content files compatible framework. more information, contact package author.           

here link repo: https://github.com/nullvoxpopuli/csharp-extensions
nuget link: https://www.nuget.org/packages/csharp-extensions/1.2.0

in project.json, specify dnx46 , dnxcore50

{     "version": "1.2.0",     "configurations": {         "debug": {             "compilationoptions": {                 "define": [ "debug", "trace" ]             }         },         "release": {             "compilationoptions": {                 "define": [ "release", "trace" ],                 "optimize": true             }         }     },     "dependencies": {         "microsoft.extensions.platformabstractions": "1.0.0-*",         "system.reflection": "4.1.0-*",         "xunit": "2.1.0-*",         "xunit.runner.dnx": "2.1.0-*"     },     "commands": {         "run": "csharp_extensions",         "test": "xunit.runner.dnx"     },     "frameworks": {         "dnx46": {             "dependencies": {                 "system.console": "4.0.0-beta-*",                 "system.reflection.typeextensions": "4.1.0-beta-*",                 "system.runtime.extensions": "4.0.11-beta-*",                 "system.dynamic.runtime": "4.0.11-beta-*",                 "microsoft.csharp": "4.0.1-beta-*",                 "system.io": "4.0.11-beta-*"             }         },         "dnxcore50": {             "_": "this recommended windows runtime",             "dependencies": {                 "system.console": "4.0.0-beta-*",                 "system.reflection.typeextensions": "4.1.0-beta-*",                 "system.runtime.extensions": "(4.0,]",                 "system.dynamic.runtime": "(4.0.0,]",                 "microsoft.csharp": "(4.0.0,]",                 "system.io": "(4.0,]"             }         }     }, } 

the project i'm trying install nuget class library targeting .net framework 4.6 (and isn't dnx project)

update:

this happens when build nuget package nuget pack enter image description here

looking @ csharp-extensions nuget package looks incorrect. has project files , no assemblies.

i assume generated running nuget.exe package package.nuspec. not generate nuget package can used nuget.org since there no assemblies.

if build .xproj in visual studio generate .nupkg in artifacts directory if have product outputs on build checked in project options, have. unfortunately .nupkg file, whilst has assemblies, has lib\dnxcore50 directory , nuget not allow install .net 4.6 project since nuget finds them incompatible. using .nupkg file in artifacts directory returns same error. seem able install artifact .nupkg dnx project (console or web app) not dnx class library project.

i take @ existing nuget packages , try generate same structure. looking @ system.xml.xmldocument example has new nuget 3 style directory structure:

\lib     \dotnet     \net46 \ref     \dotnet     \net46 

only directories above have system.xml.xmldocument.dll in them.

nuget 2 have lib directory , not support dotnet directory.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -