Azure 部署因构建错误而失败

问题描述 投票:0回答:2

我已经尝试将我的 Web 应用程序部署到 azure 两天了。当我将应用程序推送到 github 时,我已经完成了应用程序的编程,并且它在本地正常工作,并且我正在使用我的学生入门计划来部署它。应用程序开始部署,然后失败并出现错误。错误如下

/usr/share/dotnet/sdk/3.0.100/Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Identity.Stores". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolRole.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolUser.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyRole.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyUser.cs(2,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolRole.cs(5,31): error CS0246: The type or namespace name 'IdentityRole<>' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolUser.cs(7,31): error CS0246: The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyRole.cs(5,32): error CS0246: The type or namespace name 'IdentityRole<>' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyUser.cs(7,32): error CS0246: The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
    1 Warning(s)
    8 Error(s)

我什至已经将主机更改为

Azure DevOps
,但它仍然向我显示同样的事情。这促使我从头开始重写该应用程序。它在本地运行正常,但当我发布它时,它失败了。

c# azure asp.net-core azure-deployment
2个回答
0
投票

我也面临同样的问题。虽然发布 VS 构建失败 - 无法找到依赖的项目引用,但使用发布版本我能够构建解决方案。

对我有用的解决方法是 - 更新VS版本至16.7.3版本。

此版本项目构建成功通过,我能够部署包...在早期版本中,我认为依赖解析器存在问题。


0
投票

当您运行 Web 应用程序时,您需要为可能出现的任何问题做好准备,从 500 个错误到用户告诉您网站已关闭。应用服务诊断是一种智能的交互式体验,可帮助您在无需配置的情况下对应用进行故障排除。如果您的应用程序确实遇到问题,应用程序服务诊断会指出问题所在,指导您找到正确的信息,以便更轻松、更快速地排除故障并解决问题。

https://learn.microsoft.com/en-us/azure/app-service/overview-diagnostics

© www.soinside.com 2019 - 2024. All rights reserved.