Azure Custom deploy.cmd getting .nuget\nuget.targets error : An exception occurred during a WebClient request

StackOverflow https://stackoverflow.com/questions/19510492

I am trying to create a custom deploy script for Azure, following this guide... http://blog.amitapple.com/post/51576689501/testsduringazurewebsitesdeployment

But I keep getting this exception,

C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\Zenworx\.nuget\nuget.targets(83,8): error : An exception occurred during a WebClient request.

Line(83,8) in nuget.targets is;

<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />

Here is my Azure deploy log...

Command: deploy.cmd
Handling .NET Web Application deployment.
  Restoring NuGet packages...
  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
  All packages listed in packages.config are already installed.
  zenworx -> C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\zenworx\bin\zenworx.dll
  Transformed Web.config using C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\zenworx\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
  Copying all files to temporary location below for package/publish:
  C:\DWASFiles\Sites\tst-zenworx\Temp\a3de0b4d-a3a6-4370-b2dd-f76082c14730.
Building test project
C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\.nuget\nuget.targets(83,8): error : An exception occurred during a WebClient request.
An error has occurred during web site deployment.
Handling .NET Web Application deployment.
  Restoring NuGet packages...
  To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
  All packages listed in packages.config are already installed.
  zenworx -> C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\zenworx\bin\zenworx.dll
  Transformed Web.config using C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\zenworx\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
  Copying all files to temporary location below for package/publish:
  C:\DWASFiles\Sites\tst-zenworx\Temp\a3de0b4d-a3a6-4370-b2dd-f76082c14730.
Building test project
C:\DWASFiles\Sites\tst-zenworx\VirtualDirectory0\site\repository\zenworx\.nuget\nuget.targets(83,8): error : An exception occurred during a WebClient request.
An error has occurred during web site deployment.
D:\kuduservice\wwwroot\bin\scripts\starter.cmd deploy.cmd
有帮助吗?

解决方案

It sounds like your NuGetToolsPath is incorrect. Because it is trying to download Nuget.exe which means it could not find it.

Look at updating this line in the nuget.targets file to reflect where your .nuget folder is in relation to the solution root:

$(SolutionDir).nuget

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top