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

Ubuntu/Mint环境下Rider中无法启动.NET8 Azure Function项目

.NET8 Azure Function在Rider(Ubuntu/Mint)中无法启动的解决方案

问题背景

  • 环境:Ubuntu/Mint Linux + Rider + .NET8 SDK(通过dotnet-install脚本安装)
  • 核心问题:解决方案中.NET8 API项目正常运行,但Azure Function启动失败,提示dotnet sdk is required for dotnet based functions. Please install;Debug时弹出Azure Functions host did not return isolated worker process id. Could not attach the debugger;命令行运行func可正常启动,问题锁定在Rider端。
  • 附加环境:Docker运行Azurite和Cosmos容器(Cosmos工作正常)

排查与解决步骤

1. 手动指定Rider的.NET SDK路径

Rider可能未识别到dotnet-install脚本安装的SDK,需手动配置:

  • 打开File > Settings > Build, Execution, Deployment > Toolset and Build
  • 在.NET CLI executable path中,选择$HOME/.dotnet/dotnet(你的实际.NET安装路径)
  • 应用配置并重启Rider后重试

2. 配置运行环境变量

Rider运行Function时可能缺失SDK相关环境变量:

  • 打开Function项目的「Run/Debug Configurations」
  • 在「Environment variables」中添加:
    • DOTNET_ROOT:设为你的.NET根目录(如$HOME/.dotnet)
    • PATH:在原有值后追加:$HOME/.dotnet:$HOME/.dotnet/tools
  • 保存配置后重新启动Function

3. 清理Rider的Azure Functions工具缓存

工具缓存异常可能导致检测失败:

  • 关闭Rider,删除以下目录(替换[版本]为你的Rider版本号):
    ~/.local/share/JetBrains/Rider[版本]/AzureFunctionsTools
    ~/.local/share/JetBrains/Rider[版本]/dotnet
    
  • 重启Rider,让其重新检测SDK与Functions工具

4. 更新Azure Functions插件

旧版插件可能存在兼容性问题:

  • 打开File > Settings > Plugins
  • 搜索「Azure Functions」,检查并更新至最新版本,重启Rider后重试

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.25 21:32:41