【问题标题】:dotnet watch - no frameworks founddotnet watch - 未找到框架
【发布时间】:2022-12-01 10:37:35
【问题描述】:

在使用 F# 十多年后回到 .NET,我在使用 dotnet watch 运行一个非常基本的 hello world 应用程序时遇到了问题。

基本上 dotnet run 按预期启动应用程序,但 dotnet watch 失败并显示“未找到框架”。甚至 dotnet watch --help 也因此错误而失败。

我在 linux 上并安装了 .net6.0 和 .net7.0。

EDIT1:dotnet --info 的输出

.NET SDK:
 Version:   7.0.100
 Commit:    e12b7af219

Runtime Environment:
 OS Name:     endeavouros
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/7.0.100/

Host:
  Version:      7.0.0
  Architecture: x64
  Commit:       d099f075e4

.NET SDKs installed:
  6.0.111 [/usr/share/dotnet/sdk]
  7.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.NETCore.App 6.0.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

【问题讨论】:

  • 该命令在 Linux 上对我可用。似乎您的 .NET 安装有点不完整。 dotnet --info 的输出是什么?
  • @PMF 更新了问题,感谢您抽出宝贵时间,对我迟到的回答感到抱歉,在医院 rn
  • 感谢更新。不幸的是,我看不到任何异常(除了 6.0.111 不是最新的 6.0 SDK)。我不知道缺少的模块应该在哪里。 dotnet tool list -g 没有列出 watch 命令,即使它正在工作。
  • 我会尝试重新安装 SDK。
  • @PMF 似乎 watch 是必须明确安装的 aspnet 运行时的一部分,请参阅下面的答案

标签: .net linux f# command-line-interface


【解决方案1】:

recent github issue 中找到的解决方案:安装aspnet-runtime

dotnet --list-runtimes 应该包括原始错误消息中提到的“Microsoft.AspNetCore.App”。

【讨论】:

    猜你喜欢
    • 2017-12-02
    • 2018-10-30
    • 2016-10-03
    • 2014-12-07
    • 2011-09-21
    • 2018-12-02
    • 2014-07-14
    • 2013-01-25
    • 1970-01-01
    相关资源
    最近更新 更多