【问题标题】:Error running Unit Tests for .NET MAUI Apps with .NET 6 RC2使用 .NET 6 RC2 为 .NET MAUI 应用程序运行单元测试时出错
【发布时间】:2021-12-02 08:12:30
【问题描述】:

在引用使用 .NET MAUI (<UseMaui>true</UseMaui>) 的项目的 net6 单元测试项目上运行 dotnet test 会引发以下错误:

Testhost process exited with error: It was not possible to find any compatible framework version 
The framework 'Microsoft.Maui.Core', version '**FromWorkload**' (x64) was not found. 

.NET 6 Release Candidate 2 发生此错误

【问题讨论】:

    标签: .net maui


    【解决方案1】:

    这是 .NET 6 RC2 中的一个已知问题:

    https://github.com/dotnet/sdk/issues/21845

    目前,dotnet test 尚不适用于使用 dotnet workloads 的项目。由于 .NET MAUI 是作为 .NET 工作负载安装的,这意味着 dotnet test 尚不适用于 .NET MAUI 应用程序。

    更新.NET MAUI team has fixed the issue。这意味着在 .NET MAUI 项目上使用 dotnet test 将在下一个版本 .NET MAUI Preview 10 中开始工作。

    【讨论】:

      猜你喜欢
      • 2017-03-10
      • 1970-01-01
      • 1970-01-01
      • 2022-10-13
      • 1970-01-01
      • 2010-10-05
      • 1970-01-01
      • 2016-11-18
      • 1970-01-01
      相关资源
      最近更新 更多