问题
I'm creating a repository in Visual Studio OnLine
when I have some class libraries. I want to create (pack) and push for each of them a Nuget
package in my private repository.
In a project there is a dependency on Microsoft.ApplicationInsights
. If I create on my computer a package, it is working fine. If I try to do the same on Visual Studio Online I have an error:
The nuget command failed with exit code(1) and error(NuGet.CommandLine.CommandLineException: Unable to find 'Microsoft.ApplicationInsights.2.6.4.nupkg'. Make sure the project has been built.
This is the full error:
NuGet Version: 4.1.0.2450 Attempting to build package from 'Vu.Common.Logging.AppInsightsEvent.csproj'. MSBuild auto-detection: using msbuild version '15.6.85.37198' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild. Packing files from 'D:\a\1\s\Vu.Common\Vu.Common.Logging.AppInsightsEvent\bin\Release'. Using 'Vu.Common.Logging.AppInsightsEvent.nuspec' for metadata. Add file 'D:\a\1\s\Vu.Common\Vu.Common.Logging.AppInsightsEvent\bin\Release\Vu.Common.Logging.AppInsightsEvent.dll' to package as 'lib\net462\Vu.Common.Logging.AppInsightsEvent.dll' Found packages.config. Using packages listed as dependencies NuGet.CommandLine.CommandLineException: Unable to find 'Microsoft.ApplicationInsights.2.6.4.nupkg'. Make sure the project has been built. at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies) at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder) at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder) at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand() at NuGet.CommandLine.Command.ExecuteCommandAsync() at NuGet.CommandLine.Command.Execute() at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
My configuration is easy. I added two Nuget
, the first it is packing my nuget and the second push in the repository it.
I tried different configuration and also created manually the nuspec
file but without result.
Any ideas? What is the right way to pack and deploy nugget packages?
Update
During the build the error I saw is like that:
Then I tried to create the same package on my local folder. I've only removed OutputDirectory
, NonInteractive
and the initial path. I can create the package without problem.
回答1:
According to the error message, seems your nuget packages failed to download the referenced nuget packages from url.
Instead of using customize nuget command, you could try to use Package: NuGet extension directly and select Pack NuGet packages and try agian.
Also enable Verbose Debug Mode to get more detail log by add system.debug=true
for troubleshooting and narrow down the issue.
来源:https://stackoverflow.com/questions/50715419/visualstudio-online-and-pack-nuget-packages