logo
down
shadow

MSBuild NuGet.targets ,Nuget.exe : Unable to read package from path 'blah.nupkg' error


MSBuild NuGet.targets ,Nuget.exe : Unable to read package from path 'blah.nupkg' error

By : Sivart
Date : December 01 2020, 04:55 PM
it fixes the issue I had this same problem using TFS. What I did that fixed it was clear the nuget cache in the user profile that was running the build (%LocalAppData%\NuGet\Cache). I just emptied the directory and ran the build again, then it worked.
code :


Share : facebook icon twitter icon
NuGet package restore *without* changing every project in the solution to import the NuGet.targets MsBuild task

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 Projects
Please 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

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

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

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

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.
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org