Azure自定义deploy.cmd获取.nuget \ nuget.targets错误:WebClient请求期间发生异常

时间:2013-10-22 06:25:43

标签: azure deployment nuget nuget-package-restore

我正在尝试按照本指南为Azure创建自定义部署脚本... http://blog.amitapple.com/post/51576689501/testsduringazurewebsitesdeployment

但我一直得到这个例外,

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

nuget.targets中的行(83,8)是;

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

这是我的Azure部署日志......

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

1 个答案:

答案 0 :(得分:1)

听起来你的NuGetToolsPath不正确。因为它试图下载Nuget.exe,这意味着它无法找到它。

在nuget.targets文件中更新此行以反映.nuget文件夹相对于解决方案根目录的位置:

$(SolutionDir).nuget