We have some projects (Plugins) which use in several projects, the output of these projects will copy to the specific folder in the target projects (Plugins folder). We pack project with Visual studio 2019 Pack option and after that, we push npkg files to our local NuGet server for further use.
The problem is when we want to get these packages, Package Manager should put lib files in the Plugins folder, but unfortunately, the package manager extracts these in the root folder (bin).
My question is: How can I config nuspec file to force package manager to extract to the right folder, and can I do it with visual studio or I have to create nuspec file manually.
You should use a <packages_id>.props file to realize it.
create a file called
<packages_id>.props
under the build folder of your lib project.You should note that if your nupkg file is called
Plugins.1.0.0.nupkg
, you should name this file asPlugins.props
so that it will work.add these on
Plugins.props
file:add these on
Plugins.csproj
file:use Pack Button to create the new release version of your nuget pakckage.
Also, when you install this new version of nuget package, please clean your nuget caches or delete all files under
C:\Users\xxx(current user)\.nuget\packages
.When you finish the installing process, please click Build button and the files will generated under Plugins folder.
There is also a similar issue about this.