c# - Azure 部署因生成错误而失败

标签 c# azure asp.net-core azure-deployment

我已经尝试将我的 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,但它仍然向我显示相同的内容。这促使我从头开始重写该应用程序。它在本地运行正常,但当我发布它时,它失败了。

最佳答案

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

对我有用的修复是 - 将VS版本更新至16.7.3版本。

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

关于c# - Azure 部署因生成错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59142959/

相关文章:

c# - 在 Startup.cs 中生成角色在 .NET Core 2.0 中不再起作用

c# - 使用 C# 调试访问 token

ios - PasswordSignInAsync 在本地工作但不在 Azure 中工作

c# - 包括导致 InvalidCastException

api - Azure API 管理 - API 端点域与实际 API URL

azure - Docker 永远不会在 Azure 上运行 - 等待对容器预热请求的响应

c# - 升级到 3.0 后 ASP.NET Core 身份验证中断

c# - 升级到 asp.net core 2.2 后为空 href

c# - 在 .NET 中创建加密安全随机 GUID

c# - Azure 页面分页的总记录数