Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
761 stars 304 forks source link

"The target platform must be set to Windows" on iOS platform #875

Closed impworks closed 1 year ago

impworks commented 1 year ago

Adding the Plugin.MediaPlayer nuget to a project with TargetFramework = net6.0-ios results in the following build error:

NETSDK1136

The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so

C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets

How come?

martijn00 commented 1 year ago

Because .net6 is not supported yet. Please make a PR

Hobbit7 commented 1 year ago

I have the same problem. I use Visual Studio 2022 for Mac 17.4 (build 2406) and I get this error message in my iOS project after installing the Plugin.MediaManager NuGet package:

/usr/local/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(5,5): Error NETSDK1136: The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so. (NETSDK1136)

I only get this error in my iOS project, in my Android project I don't get this error. When will this problem be solved?

Hobbit7 commented 1 year ago

Because .net6 is not supported yet. Please make a PR

I use TargetFramework net6.0-ios in my csproj file. Can I do something in Visual Studio for Mac 2022 to fix the "The target platform must be set to Windows" error or is it necessary to wait until a new NuGet package version is released? When will this problem be fixed?