NuGet package restore *without* changing every project in the solution to import the NuGet.targets MsBuild task
By : Sneak_Stealth
Date : March 29 2020, 07:55 AM
I wish this help you At the moment, NuGet Package Restore has some limitations and can't be restricted to specific projects. There's an existing NuGet work item that would make this possible : #1812 - Enable Package Restore - Selective ProjectsPlease comment/vote on it to bump the priority since it's currently backlogged.
|
How to create a NuGet package with MSBuild tasks and a targets file
By : fgdslime
Date : March 29 2020, 07:55 AM
This might help you The BuildPackage property is defined in the NuGet.targets file. Looking at the NuGet.targets file when BuildPackage is true the following command line is run: code :
NuGet.exe pack YourProject.csproj
NuGet.exe pack YourManifest.nuspec
|
Use MSBuild Targets to copy files recursively from NuGet package
By : Salim
Date : March 29 2020, 07:55 AM
Does that help To avoid having to the package version you could use the MSBuildThisFileDirectory property instead. The MSBuildThisFileDirectory property gives you the directory where the .targets file is so you can change the element to use a path relative to that directory and you do not have to use the version number. code :
<FilesToCopy Include="$(MSBuildThisFileDirectory)myfolder\**\*.*"/>
|
How are we supposed to execute package build targets in the new world where nuget packages are consumed through msbuild
By : Albert Huang
Date : March 29 2020, 07:55 AM
Any of those help If you are running Restore and other targets during the build, you may get unexpected results due to NuGet modifying xml files on disk or because MSBuild files imported by NuGet packages aren't imported correctly.
|
Project SDK (.Net Standard): Official way to create a nuget package that includes msbuild targets
By : user2933971
Date : March 29 2020, 07:55 AM
This might help you As per the docs, the props and targets file names must match the package id exactly. Your nuspec lists the as TestingNugetContent, so the files must be TestingNugetContent.props and TestingNugetContent.targets. They should be either directly in the build/ folder in the package, or the build// folder (I prefer to be more explicit, so I appriciate you used the netstandard2.0 TFM). Now, your csproj appears to specify a build\netstandard2.0\TestingNugetContent.targets, which looks correct, so I can only guess that it wasn't packed into the correct location somehow. I don't currently have time to show an example on how to pack it, but you can inspect the contents of your nupkg using NuGet package explorer, or just opening it up as a zip file, see what's "wrong", then adjust your project and try again.
|