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

Sentry.Maui fails to install if the .NET workloads are not current. #1724

Closed
mattjohnsonpint opened this issue Jun 15, 2022 · 3 comments · Fixed by #1728
Closed

Sentry.Maui fails to install if the .NET workloads are not current. #1724

mattjohnsonpint opened this issue Jun 15, 2022 · 3 comments · Fixed by #1728
Assignees
Labels
Bug Something isn't working MAUI

Comments

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Jun 15, 2022

Installing Sentry.Maui will fail if the MAUI workloads are too old. I thought I had the latest version (6.0.312), but the CI server that made the nuget package got MAUI 6.0.400 as the minimum dependency because that was the version of the workloads it installed.

So, when trying to add the package to a new project, I got package downgrade failures.

Everything works fine after dotnet workload update

We need to figure out how to set a minimum dependency level so this doesn't happen again.

matt@Matts-MacBook-Pro Test % dotnet new maui
The template ".NET MAUI App" was created successfully.

matt@Matts-MacBook-Pro Test % dotnet add package Sentry.Maui -v 3.18.0-preview.1   
  Determining projects to restore...
  Writing /var/folders/1h/m0k6xr157rdfm_g8_tmtkkdm0000gn/T/tmpijCZnr.tmp
info : Adding PackageReference for package 'Sentry.Maui' into project '/Users/matt/Code/test/test.csproj'.
info : Restoring packages for /Users/matt/Code/test/test.csproj...
error: NU1605: Detected package downgrade: Microsoft.Maui.Dependencies from 6.0.400 to 6.0.312. Reference the package directly from the project to select a different version. 
error:  test -> Sentry.Maui 3.18.0-preview.1 -> Microsoft.Maui.Dependencies (>= 6.0.400) 
error:  test -> Microsoft.Maui.Dependencies (>= 6.0.312)
error: NU1605: Detected package downgrade: Microsoft.Maui.Extensions from 6.0.400 to 6.0.312. Reference the package directly from the project to select a different version. 
error:  test -> Sentry.Maui 3.18.0-preview.1 -> Microsoft.Maui.Extensions (>= 6.0.400) 
error:  test -> Microsoft.Maui.Extensions (>= 6.0.312)
info : Package 'Sentry.Maui' is compatible with all the specified frameworks in project '/Users/matt/Code/test/test.csproj'.
info : PackageReference for package 'Sentry.Maui' version '3.18.0-preview.1' added to file '/Users/matt/Code/test/test.csproj'.
info : Generating MSBuild file /Users/matt/Code/test/obj/test.csproj.nuget.g.props.
info : Generating MSBuild file /Users/matt/Code/test/obj/test.csproj.nuget.g.targets.
info : Writing assets file to disk. Path: /Users/matt/Code/test/obj/project.assets.json
log  : Failed to restore /Users/matt/Code/test/test.csproj (in 401 ms).
@mattjohnsonpint
Copy link
Contributor Author

Turns out this was pretty easy to do with the <MauiVersion> tag. I've set that for the next preview so we hopefully shouldn't have this issue in the future.

@mattjohnsonpint
Copy link
Contributor Author

Actually, it turns out that it was a bug in MAUI, which has been fixed. See. dotnet/maui#8032

<MauiVersion> should be removed.

@mattjohnsonpint
Copy link
Contributor Author

Note that the MAUI fix is already evident by lack of MAUI dependencies on Sentry.Maui 3.20.0-preview.2 and newer.

https://www.nuget.org/packages/Sentry.Maui/3.20.0-preview.2#dependencies-body-tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working MAUI
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant