0

我正在尝试按照本指南为 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 中的 Line(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
4

1 回答 1

1

听起来您的 NuGetToolsPath 不正确。因为它正在尝试下载 Nuget.exe,这意味着它找不到它。

查看更新 nuget.targets 文件中的这一行,以反映您的 .nuget 文件夹与解决方案根目录的关系:

$(SolutionDir).nuget

于 2013-10-24T17:08:07.187 回答