-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[workload] support $(UseMaui) from a net6.0 TFM #1788
Conversation
If you try to enable `$(UseMaui)` in a `net6.0` project, you get errors during `restore` like: error NU1101: Unable to find package Microsoft.Maui.Core.Ref.. No packages exist with this id in source(s): C:\src\maui\bin\dotnet\library-packs, dotnet-eng, dotnet-public, dotnet6, xamarin Note the `..` is caused by `$(_MauiPlatformName)` being blank in `BundledVersions.targets`. The solution here is to an `any` pack for all `.Ref` and `.Runtime` packs. Unfortunately, we will need `net6.0` versions of all assemblies in order to do this. This is blocked until `net6.0` can be added to `$(MauiPlatforms)`: https://github.com/dotnet/maui/blob/f95c2e5c9a6e19817c75ddb93fae98ca8739399f/Directory.Build.props#L13 I would do it myself, but there are many C# compiler errors I don't know about. It appears that the `$(DefineConstants)` in place expect some platform to be there. The remaining changes here *should* get `net6.0` working in a workload, but I can't test it yet.
I think this can be finished when this lands: #1359 @mattleibow is going to add the |
My PR is almost green. Just gotta fix some of the weirdness in the CI and then we can merge. I'll rebase this. |
This probably won’t work first try, the build actually couldn’t get that far because the .dll files it needs are missing. Just let me know and I’ll try it out. |
The main sample app is now net6 friendly
I updated this PR and also removed the sample project. The main sample project is not net6.0 compatible and builds locally. So this PR should be adding the any and the samples should build on CI. |
Should this section just always include
I don't understand how |
Ok, I see this only would break if we are using the workload with
So we should remove this here, thanks. |
Seems to be working, in general:
But then if I look at the I think the |
Otherwise, they get included as references.
Description of Change
If you try to enable
$(UseMaui)
in anet6.0
project, you geterrors during
restore
like:Note the
..
is caused by$(_MauiPlatformName)
being blank inBundledVersions.targets
.The solution here is to add an
any
pack for all.Ref
and.Runtime
packs. Unfortunately, we will need
net6.0
versions of all assembliesin order to do this.
This is blocked until
net6.0
can be added to$(MauiPlatforms)
:maui/Directory.Build.props
Line 13 in f95c2e5
I would do it myself, but there are many C# compiler errors I don't
know about. It appears that the
$(DefineConstants)
in place expectsome platform to be there.
The remaining changes here should get
net6.0
working in aworkload, but I can't test it yet.
PR Checklist
Does this PR touch anything that might affect accessibility?
No