Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Error loading macOS .NET 6 workload project in Rider #2621

Open
alastairlundy opened this issue Feb 20, 2024 · 2 comments
Open

[macOS] Error loading macOS .NET 6 workload project in Rider #2621

alastairlundy opened this issue Feb 20, 2024 · 2 comments

Comments

@alastairlundy
Copy link

Hi, I just created an Eto app on macOS using the dotnet template for the first time (usually I do so on Windows or Linux). I figured since this is my first time creating an Eto Forms project on macOS that I'd try the .NET 6 workload project so I created the project with that as an option. I created a new solution in Rider and started adding the projects generated by the tempate and Rider says it's unable to load the macOS workload project.

Expected Behavior

The macOS .NET 6 workload project loads in Rider.

Actual Behavior

The macOS .NET6 workload project fails to load in Rider due to an error.

The error message is:

[NETSDK1135] SupportedOSPlatformVersion 10.14 cannot be higher than TargetPlatformVersion 0.0. at (215:5)

Target: _CheckForSupportedOSPlatformVersionHigherThanTargetPlatformVersion 
Task: NETSdkError

Specifying a TargetPlatformVersion doesn't help and causes it's own error. I supplied it with 13.0 which should be a valid version.

[NETSDK1140] 13.0 is not a valid TargetPlatformVersion for macos. Valid versions include: None at (243:5) 
Target: _CheckForInvalidTargetPlatformVersion
Task: NetSdkError

Steps to Reproduce the Problem

  1. Open a solution containing a macOS workload project in Rider on macOS
  2. Try to load the macOS workload project

Code that Demonstrates the Problem

Here's the contents of the CSPROJ file for the macOS .NET 6 workload.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0-macos</TargetFramework>
    <OutputType>Exe</OutputType>
    <SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
    <RuntimeIdentifiers>osx-x64;osx-arm64</RuntimeIdentifiers>
  </PropertyGroup>
	
  <ItemGroup>
    <PackageReference Include="Eto.Platform.macOS" Version="2.8.2" />
  </ItemGroup>
	
  <ItemGroup>
    <ProjectReference Include="..\Packaging\Packaging.csproj" />
  </ItemGroup>
</Project>

Specifications

  • Version: Eto.Forms v2.8.2
  • Platform(s): macOS workload (.NET 6)
  • Operating System(s): macOS 13.6.3

Notes

As an aside, I'd recommend adding the references to the Eto Forms dotnet template via using statements so that the projects can be built out of the box (barring any other issue(s)) as the template's projects need tweaking to work. Thankfully Rider says what the problems are but it would be nice for these to also be fixed.

Thanks in advance.

@cwensley
Copy link
Member

cwensley commented Mar 8, 2024

Do you by any chance have .NET 8 SDK installed? Apparently the net6.0-macos workload is not supported with that, and follows the MAUI support policy. Looks like the macos versions should be bumped to at least .NET 7.

@alastairlundy
Copy link
Author

alastairlundy commented Mar 14, 2024

Do you by any chance have .NET 8 SDK installed? Apparently the net6.0-macos workload is not supported with that, and follows the MAUI support policy. Looks like the macos versions should be bumped to at least .NET 7.

Sorry for the late response.

Yes, I do have the .NET 8 SDK installed.

If I understand the .NET MAUI support policy correctly then the .NET 7 workload will soon have the same issue, so perhaps .NET 8 would be a safer choice.

Edit: This also works: explicitly stating that if you want to use .NET 6 MAUI for Mac that you need to only have the .NET 6 SDK installed and allow people who want to use .NET 8 MAUI to choose that if they have the .NET 8 SDK installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants