Maui dotnet 8 works with dotnet build - not inside visual studio for mac 17.6.7

235 views Asked by At

i have a Maui solution I upgraded from dotnet 7 to dotnet 8 it fails in visual studio for mac 17.6.7 on dotnet command line it builds just fine. Can i make this so;ution build inside moc visual studio? ig so How?

in Visual studio for mac 17.6.7

I get the error message:

/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)

when i go to the solution folder which has 5 csproj

mwardell@Marks-MBP DomaFramework % dotnet build

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
2

There are 2 answers

0
tonyedwardspz On

I believe you need to enable preview features within the Visual Studio Mac settings, as a build started via the terminal is working fine.

Within VS MAC, go to Preferences > Other > Preview Features. Check the box to use the .NET 8 SDK if installed.

0
Mark Wardell On

I see as i search on MS has stopped at dotnet 7 for vs for mac - Moving to Rider

enter image description here