Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Pack a .net standard 2.0 nuget package with local dll`s references and local nuget package

$
0
0

I have a .net standard 2.0 class library project with the following setup:

  • At the solution root folder (the .sln file location) I have a nuget package (Which also hasother nuget dependencies) a co-worker wrotewhich I need to use. I configured this location as a package source and added the nuget packagethrough package manager.
  • At the solution root folder (the .sln file location) I also have 'dlls' folder in which i havea dll I added refence to manually (through refence manager)

This is the class library with the dependencies

enter image description here

I try pack at using VS 19 right clicking on the project and 'Pack' option. But only the class library dll is added

So I also tried packing it with .nuspec file to take all files from release folder

<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata>          ...        ...<!-- Dependencies are automatically installed when the package is installed --><dependencies> <group targetFramework=".NETStandard2.0"></group></dependencies> </metadata><files><file src=".\bin\Release\netstandard2.0\*.*" target="lib\netstandard2.0" /></files></package>

And it does pack all dlls. But There I get an exception when running the application which used the generated nuget package.

System.PlatformNotSupportedException: 'Windows Data Protection API (DPAPI) is not supported on this platform.'

I am testing it using .net core 3.0 console app.

If I use the class library I try to pack by adding it as a project reference to the console app, it all works perfect.

What am I doing wrong?

EDIT:

As @Lasse V. Karlsen requested, I tried unpacking the nuget and add the dlls as references and did noticed some problem.

So, Again this is the class library with the nuget package my co-worker wrote. with the packages refernced by that package extended, Pay attention to System.Security.Cryptography.ProtectedData

enter image description here

When add my nuget package to console app:

enter image description here

But when I try to unpack the package and add the dlls refernces, I get an error on 3 of the dlls System.Security.Cryptography.ProtectedData depends on. Those which marked at the pictures.I get this error when try to add them:

enter image description here


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>