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

How do I Pin a Maui App to a specific version? #8985

Closed
dmccolloughOneGas opened this issue Jul 25, 2022 Discussed in #8886 · 17 comments
Closed

How do I Pin a Maui App to a specific version? #8985

dmccolloughOneGas opened this issue Jul 25, 2022 Discussed in #8886 · 17 comments

Comments

@dmccolloughOneGas
Copy link

Discussed in #8886

Originally posted by dmccolloughOneGas July 21, 2022
I created a new Maui App on my PC using VS2022 17.3.0 - Preview 3.0

When I open the solution and expand the dependicies I see that they are 6.0.408
If I look at the maui releases page, I see that it corresponds to Maui SR 2 - 6.0.408

Maui Releases

Maui GA - 6.0.312
Maui SR1 - 6.0.400
Maui SR2 - 6.0.408
Maui SR3 - 6.0-.419

So if I wanted to rollback my new app to the GA version of Maui, I read that I should use
a global.json file, so I tried adding one with the command
dotnet new globaljson --sdk-version 6.0.312

{
    "sdk": {
    "version": "6.0.312",
    "rollForward": "disable"
}

After reloading the solution, my dependencies are still at 6.0.408

I then tried running the command below based on a comment in this url.

dotnet workload restore --from-rollback-file https://aka.ms/dotnet/maui/6.0.312.json --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json

The output from the above command 'A compatible .NET SDK was not found.'

I read a comment from David Ortinau at this link that said Maui was tied to a .NET SDK version, if that's the case, how are we supposed to know which .NET SDK version goes to which version of Maui?

My intended outcome as I move forward with Maui in porting applications and creating new applications is that I know how to use a old version of Maui should a breaking change be introduced.

For example:
      If my app is using Maui SR2 - 6.0.408 and I attempt to upgrade it to SR3 - 6.0.419
      and for whatever reason SR3 horribly breaks my app and I need to revert to SR2.
      How do I go about doing this?

I've spent day's trying to figure this out.
So either I'm really stupid (I probably am) or this isn't as easy as I've seen alot of people making it out to be and I've seen alot of other people asking the same thing.

Perhaps maybe Gerald or James could make a nice video on how to accomplish this more maybe some straight forward documentation on how to make this work. A video, would be SUPER awesome!!!!!!!!

Thanks

@danch15
Copy link

danch15 commented Jul 26, 2022

#8544

@marcmognol
Copy link
Contributor

Yes but it is supposed to be removed:

#4812 (comment)

We need a supported solution.

@MagicAndre1981
Copy link
Contributor

I already asked it some time ago ( #7069 ) and for Microsoft it is the best to not allow use the control used MAUI version:

MAUI is a dotnet workload component, along with the platform (iOS, Android, macOS, etc) SDKs. These are versioned internally but are not directly exposed to you. The idea is that you would always run the newest version of any given workload

I don't like this and the ugly commands pointing to a json to install a specific version is crap

@J-Swift
Copy link
Contributor

J-Swift commented Jul 26, 2022

Yeah, not to pile on but I'm really struggling to understand and get behind the motivation for the workload system. It seems extremely optimistic to assume new versions will A) be compatible and B) not introduce regressions so as to always expect all teams and all projects to be on "latest" at all times.

It also seems regressive (in a software delivery sense) to attach the workload distribution to a monolithic release cycle of Visual Studio. So when things do regress, you have to wait for an unrelated release (a Visual Studio update) to get cut before you can get what you really want (a Maui version update).

All that said, I've also been thinking about how we are supposed to achieve version pinning and had been using global.json + MauiVersion as the solution for now. It was news to me that MauiVersion is no longer supported.

@MagicAndre1981
Copy link
Contributor

Yeah, not to pile on but I'm really struggling to understand and get behind the motivation for the workload system. It seems extremely optimistic to assume new versions will A) be compatible and B) not introduce regressions so as to always expect all teams and all projects to be on "latest" at all times.

for Microsoft newer is always better. I had the same discussions years ago, when I requested an option to rollback to last version of store app after updating it from store. And here Microsoft also declined this because newer is always better. So a crashing new version is better compared to a working older version because version number is higher 🤦‍♂️ 🤷‍♂️

It also seems regressive (in a software delivery sense) to attach the workload distribution to a monolithic release cycle of Visual Studio. So when things do regress, you have to wait for an unrelated release (a Visual Studio update) to get cut before you can get what you really want (a Maui version update).

I agree it is strange

@ScofieldOY
Copy link

for me, I just want to know how to pin MAUI 419 using rollback json file: #8066

@ioiooi
Copy link

ioiooi commented Aug 4, 2022

Didn't Maui 6.0.400 break IsVisible bindings? 😅

As of now pinning Maui by setting MauiVersion in the .csproj still seems to work and ist imho the most convenient way. It also seems to work for my team when building the Application in Azure DevOps Pipelines. No fiddling around with --from-rollback-file which btw Microsoft also discourages. 🙄

For the time being my team is going to keep using it because always upgrading to the latest version is not an option.

@juwens
Copy link

juwens commented Jan 26, 2023

It's even worse, the whole concept seems flawed.

I have two build servers with the exact same VS 2022 (17.4.33213.308)
But VS installed different MAUI versions. How is that possible?

image

So the build now is broken on one Build-Server, but works on the other #11579

Setting <MauiVersion>7.0.52</MauiVersion> in csproj changes nothing

@vslee
Copy link

vslee commented Jan 26, 2023

Perhaps this issue will be solved by PR #11206

@juwens
Copy link

juwens commented Jan 27, 2023

Any idea, how i can downgrade from 7.0.58 to 7.0.52?

I tried dotnet workload update --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.52.json, but no luck.

Problem seems to be, that "dotnet workload" will always pick the latest available Version of the .net "7.0.1xx" band, which is maui "7.0.58".

Any suggestions?

C:\dev> dotnet workload update --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.52.json

No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.workload.emscripten.net7.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net7.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net6.
Updated advertising manifest microsoft.net.workload.emscripten.net6.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
The machine has a pending reboot. Installation will continue, but you may need to restart.
Downloading microsoft.net.sdk.ios.manifest-7.0.100.msi.x64 (16.1.1481)
Downloading microsoft.net.sdk.maccatalyst.manifest-7.0.100.msi.x64 (16.1.1481)
Downloading microsoft.net.sdk.macos.manifest-7.0.100.msi.x64 (13.0.2036)
Downloading microsoft.net.sdk.tvos.manifest-7.0.100.msi.x64 (16.1.1481)
No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.

Successfully updated workload(s): .

C:\dev> dotnet workload list

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-windows               7.0.58/7.0.100         VS 17.4.33213.308
maui-maccatalyst           7.0.58/7.0.100         VS 17.4.33213.308
maccatalyst                16.2.1007/7.0.100      VS 17.4.33213.308
maui-ios                   7.0.58/7.0.100         VS 17.4.33213.308
ios                        16.2.1007/7.0.100      VS 17.4.33213.308
maui-android               7.0.58/7.0.100         VS 17.4.33213.308
android                    33.0.26/7.0.100        VS 17.4.33213.308

Use `dotnet workload search` to find additional workloads to install.

content of the "7.0.52.json" rollback file:

{
  "microsoft.net.sdk.android": "33.0.4/7.0.100",
  "microsoft.net.sdk.ios": "16.1.1481/7.0.100",
  "microsoft.net.sdk.maccatalyst": "16.1.1481/7.0.100",
  "microsoft.net.sdk.macos": "13.0.2036/7.0.100",
  "microsoft.net.sdk.maui": "7.0.52/7.0.100",
  "microsoft.net.sdk.tvos": "16.1.1481/7.0.100",
  "microsoft.net.workload.mono.toolchain.net6": "7.0.1/7.0.100",
  "microsoft.net.workload.mono.toolchain.net7": "7.0.1/7.0.100",
  "microsoft.net.workload.emscripten.net6": "7.0.1/7.0.100",
  "microsoft.net.workload.emscripten.net7": "7.0.1/7.0.100"
}

@MagicAndre1981
Copy link
Contributor

Perhaps this issue will be solved by PR #11206

hopefully, but we can use it similar to XF to update/downgrade MAUI, but I have my doubts

@Hooterr
Copy link

Hooterr commented Jan 29, 2023

I have the same issue. I made the mistake of running dotnet workload update so that I can use the newer version that fixes the bugs I'm interested in. It asked me to update to XCode 14.2 but when I did I found out that VS studio for mac doesn't support it yet. Then I looked at the workload list to see that the installation source is VS 17.4.4 that I don't even have installed!!! And now you tell me that I can't roll back the installation because it's not my decision which version of MAUI I should be using even though the one you just released is not supported by your own IDE.
What a freaking disaster...

@LennoxP90
Copy link

LennoxP90 commented Jan 30, 2023

place in .csproj file.

<!-- Pin the MAUI version -->
<MauiVersion>7.0.52</MauiVersion>

@dmccolloughOneGas
Copy link
Author

@LennoxP90 Review this link. Redth said on 03/22/2022 that it is no longer supported.

#4812 (comment)

@LennoxP90
Copy link

well it is still working for me, but I guess we need an alternative

@mattleibow
Copy link
Member

Duplicate of #12998

@mattleibow mattleibow marked this as a duplicate of #12998 Mar 8, 2023
@mattleibow
Copy link
Member

See this comment for a fair bit more info: #12998 (comment)

@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests