mono / mono

Mono open source ECMA CLI, C# and .NET implementation.
https://www.mono-project.com
Other
11.14k stars 3.82k forks source link

Unable to build a Xamarin iOS project : The TargetFramework value 'net6.0-ios16.0' was not recognized #21570

Open omatrot opened 2 years ago

omatrot commented 2 years ago

I'm trying to build a Xamarin iOS project targeting .NET6.

Here is the log of the corresponding task:

/Library/Frameworks/Mono.framework/Versions/6_12_20/bin/msbuild /Users/runner/work/1/s/TestApplication.sln /p:Configuration=Release /p:Platform=iPhone /p:BuildIpa=true /t:Rebuild /p:Codesignkey=iPhone Distribution: MATROT.TECH (N4L9J586GK) /p:CodesignProvision=27840f37-4f16-455a-8767-8c384fb96543
Microsoft (R) Build Engine version 16.10.1 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 10/28/2022 10:04:13 AM.
Project "/Users/runner/work/1/s/TestApplication.sln" on node 1 (Rebuild target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Release|iPhone".
Project "/Users/runner/work/1/s/TestApplication.sln" (1) is building "/Users/runner/work/1/s/TestApplication/TestApplication.csproj" (2) on node 1 (Rebuild target(s)).
/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(93,5): error NETSDK1013: The TargetFramework value 'net6.0-ios16.0' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]
Done Building Project "/Users/runner/work/1/s/TestApplication/TestApplication.csproj" (Rebuild target(s)) -- FAILED.
Done Building Project "/Users/runner/work/1/s/TestApplication.sln" (Rebuild target(s)) -- FAILED.

Build FAILED.

It works well in Visual Studio.

lambdageek commented 2 years ago

Please use dotnet build, not msbuild for building net6.0 projects