Skip to content

MSBuild.Sdk.Extras cannot build the TargetFrameworks Xamarin.iOS and net6.0-ios together #291

@VincentUhlmann

Description

@VincentUhlmann

Issue Description

A Binding Project for iOS based on MSBuild.Sdk.Extras.3.0.44 with the TargetFrameworks Xamarin.iOS and net6.0-ios throws the following error under Visual Studio 2022 for Mac when building: "If you are building projects that require targets from full MSBuild or MSBuildFrameworkToolsPath, you need to use desktop msbuild ('msbuild.exe') instead of 'dotnet build' or 'dotnet msbuild".

I also noticed that if I remove one of the target frameworks ( Xamarin.iOS / net6.0-ios) and change nothing else, the build works.

A Binding Project for Android based on MSBuild.Sdk.Extras.3.0.44 with the TargetFrameworks MonoAndroid and net6.0-android works fine under Windows in Visual Studio 2022. I'm not sure if this is a bug or the Visual Studio 2022 for Mac version just isn't ready yet. However, I can't find a way to build a Binding Project for these TargetFrameworks at the moment. But this is mandatory to make a plugin compatible between Xamarin and Maui.

Steps to Reproduce

Create a Binding Project in Visual Studio 2022 for Mac and set the TargetFrameworks Xamarin.iOS and net6.0-ios and specify the Project SDK to MSBuild.Sdk.Extras.3.0.44.

Try to build this.

Expected Behavior

The build works without error.

Actual Behavior

Error: If you are building projects that require targets from full MSBuild or MSBuildFrameworkToolsPath, you need to use desktop msbuild ('msbuild.exe') instead of 'dotnet build' or 'dotnet msbuild.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions