Maui dotnet 8 可与 dotnet build 配合使用 - 不在 Visual Studio for mac 17.6.7 内

问题描述 投票:0回答:2

我有一个毛伊岛解决方案,我从 dotnet 7 升级到 dotnet 8,它在 Visual Studio for mac 17.6.7 中在 dotnet 命令行上失败,它构建得很好。我可以在 moc Visual Studio 中构建这个解决方案吗? ig 怎么样?

在 Visual Studio for Mac 17.6.7 中

我收到错误消息:

/usr/local/share/dotnet/sdk/7.0.403/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(5,5): Error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0.  Either target .NET 7.0 or lower, or use a version of the .NET SDK that supports .NET 8.0. Download the .NET SDK from https://aka.ms/dotnet/download (NETSDK1045) (Doma.SharedInterfaces)

当我转到有 5 个 csproj 的解决方案文件夹时

mwardell@Marks-MBP DomaFramework % dotnet 构建

MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Doma.SharedInterfaces -> /Users/mwardell/src/testmasters/DomaFramework/Doma.SharedInterfaces/bin/Debug/net8.0/Doma.SharedInterfaces.dll
  Doma.DataLayer -> /Users/mwardell/src/testmasters/DomaFramework/Doma.DataLayer/bin/Debug/net8.0/Doma.DataLayer.dll
  Doma.DataLayer.Tests -> /Users/mwardell/src/testmasters/DomaFramework/Doma.DataLayer.Tests/bin/Debug/net8.0/Doma.DataLayer.Tests.dll
  Detected signing identity:

    Bundle Id: mil.navy.doma
    App Id: mil.navy.doma
  Doma -> /Users/mwardell/src/testmasters/DomaFramework/Doma/bin/Debug/net8.0/Doma.dll
  Detected signing identity:

    Bundle Id: mil.navy.doma
    App Id: mil.navy.doma
  Doma -> /Users/mwardell/src/testmasters/DomaFramework/Doma/bin/Debug/net8.0-maccatalyst/maccatalyst-arm64/Doma.dll
  Doma -> /Users/mwardell/src/testmasters/DomaFramework/Doma/bin/Debug/net8.0-ios/iossimulator-arm64/Doma.dll
  Doma -> /Users/mwardell/src/testmasters/DomaFramework/Doma/bin/Debug/net8.0-android/Doma.dll
  Doma.SharedInterfaces -> /Users/mwardell/src/testmasters/DomaFramework/Doma.SharedInterfaces/bin/Debug/net8.0/Doma.SharedInterfaces.dll
  Doma.DataLayer -> /Users/mwardell/src/testmasters/DomaFramework/Doma.DataLayer/bin/Debug/net8.0/Doma.DataLayer.dll
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
  Doma.Tests -> /Users/mwardell/src/testmasters/DomaFramework/Doma.Tests/bin/Debug/net8.0/Doma.Tests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:09.63
.net maui visual-studio-mac
2个回答
0
投票

我相信您需要在 Visual Studio Mac 设置中启用预览功能,因为通过终端启动的构建工作正常。

在 VS MAC 中,转到首选项 > 其他 > 预览功能。如果已安装,请选中此框以使用 .NET 8 SDK。


0
投票

我发现我在 MS 上的搜索已停止在 dotnet 7 for vs for mac - 转向 Rider

© www.soinside.com 2019 - 2024. All rights reserved.