You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure App Service部署.NET6项目报EISDIR非法目录操作错误

Blazor WebAssembly 升级 .NET 6 后 Azure App Service 部署失败问题

问题现象

将 Asp.net Core Blazor WebAssembly 应用升级至 .NET 6 后,本地运行一切正常,通过 GitHub Actions 部署到 Azure App Service 时失败,报错日志如下:

...
Copying file: 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.dll'
Copying file: 'Microsoft.AspNetCore.Authentication.JwtBearer.dll'
Omitting next output lines...
Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'
An error has occurred during web site deployment.
Kudu Sync failed
/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

已确认信息

  • 应用本地运行正常
  • 已在 Azure 配置中将应用运行时版本更新为 .NET 6
  • 已尝试重启应用服务
  • 应用部署区域为美国中部

根因分析

报错核心EISDIR: illegal operation on a directory表示程序尝试将目录作为文件进行操作,触发了系统限制。
旧版本部署后,许可证文件路径为/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE/LICENSE,即外层LICENSE是目录,内层才是许可证文件。升级到 .NET 6 后,新版本对应位置的LICENSE直接是独立的许可证文件,没有外层目录。部署时 Kudu 同步工具尝试将原有LICENSE目录替换为新的LICENSE文件时触发冲突,导致部署流程中断。

解决方案

删除 Azure 站点内的/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE目录即可,可通过 Azure 门户的 Kudu 控制台进入站点文件管理完成删除操作,删除后重新触发部署即可正常完成。

内容的提问来源于stack exchange,提问作者Alamakanambra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.26 02:15:05