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

GitHub Actions中dotnet publish识别含点号MAUI项目报错的解决方法

GitHub Actions中MAUI项目含点号时dotnet publish找不到项目文件的解决办法

问题场景

在GitHub Actions中为MAUI应用配置CI/CD流程,执行dotnet publish命令时,若项目名称包含点号(例如AppTest.Maui),会出现项目文件找不到的错误。

错误的Build步骤:

- name: Build
  run: dotnet publish AppTest.Maui/AppTest.Maui.csproj

报错信息

MSBUILD : error MSB1009: Project file does not exist.

排查过程

  • 确认问题由项目名称中的点号导致:将项目重命名为不含点号的AppTest后,以下命令可正常运行:
- name: Build
  run: dotnet publish AppTest/AppTest.csproj 
  • 尝试用下划线替代点号等其他写法,均未解决问题。

解决方案

为包含点号的项目路径添加双引号,正确的命令写法如下:

- name: Build
  run: dotnet publish "AppTest.Maui/AppTest.Maui.csproj"

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.31 08:56:05