【发布时间】:2016-01-06 04:31:30
【问题描述】:
我是 .NET 领域的初学者,我试图让我的第一个虚拟 .NET Core webapp 在 Azure 应用服务上运行。
代码可以在这里找到: https://github.com/jordi-chacon/bcn_pollution
我的开发机器运行的是 Ubuntu,所以我使用的是 Visual Studio Code。
我目前在 localhost:5000 上运行我的 .NET Core webapp 很好,现在我希望它在 Azure App Service 上运行。
我已在我的应用服务上成功配置持续部署以从 Github 获取代码。
然后 Azure 尝试部署我的 webapp,但失败并出现以下错误:
Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --aspNet5 "D:\home\site\repository\project.json" --aspNet5Version "1.0.0-rc1-final" --aspNet5Runtime "CLR" --aspNet5Architecture "x86"'.
Project file path: .\project.json
Generating deployment script for ASP.NET 5 Application
Generated deployment script files
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET 5 Web Application deployment.
Downloading dnx-clr-win-x86.1.0.0-rc1-final from https://www.nuget.org/api/v2
Unable to download package: An exception occurred during a WebClient request.
At C:\Program Files
(x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\dnvm.ps1:694 char:13
+ throw "Unable to download package: {0}" -f
$Global:downloadData.Erro ...
+
Failed exitCode=1, command=PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='"D:\local\UserProfile\.dnx\temp-set-envvars.cmd"';& 'C:\Program Files (x86)\SiteExtensions\Kudu\50.41223.1987\bin\scripts\dnvm.ps1' " install 1.0.0-rc1-final -arch x86 -r CLR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unable to downl...Client requ
An error has occurred during web site deployment.
est.:String) [], RuntimeException
+ FullyQualifiedErrorId : Unable to download package: An exception occurred during a WebClient request.
有人知道我做错了什么吗? 谢谢!
【问题讨论】:
-
我不知道您正在使用的存储库,但最好从开发团队的Sample 开始。鉴于 dnx 仅在 RC 中,您的 clr 和项目之间错过的更改可能会导致严重的并发症(至少 aspnet/Home 存储库肯定会更新)。
-
感谢您的回复布拉德。我只是按照“在 linux 上安装 asp.net”指南 (docs.asp.net/en/latest/getting-started/installing-on-linux.html) 告诉我安装 dnx。我项目中的代码是通过
yo aspnet创建的。我没有编辑任何一行代码。我不知道如何在没有 dnx 的情况下从开发团队编译/启动 Sample .. -
据我所知,yeoman 生成器暂时没有更新。根据 aspnet/announcements 存储库,我的理解是他们将精力集中在产品上。更多从示例项目开始的理由;至少这与 clr 更改保持同步。
-
顺便说一句,作为参考,github.com/aspnet/Announcements/issues/102 他们在两个月前(以及几个版本)之前专注于命令行(yeoman)上的视觉工作室脚手架
-
感谢布拉德提供的宝贵信息。即使我让我的网站正常工作,我还是想听从你的建议。问题是我不知道如何在本地或 Azure 中运行(我是超级初学者..),有没有关于如何做到这一点的指南?