Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Microsoft.Toolkit.Wpf.UI.Controls incompatible with .Net 5.0 #296

Open
1 task
matthew25187 opened this issue Nov 26, 2020 · 28 comments
Open
1 task

Microsoft.Toolkit.Wpf.UI.Controls incompatible with .Net 5.0 #296

matthew25187 opened this issue Nov 26, 2020 · 28 comments
Labels
feature request 📬 WinUI3_revisit This issue should be revisited when WinUI 3 Islands is available XamlIslands 🏝️

Comments

@matthew25187
Copy link

Describe the bug

If I try to compile a .Net 5.0 WPF application that includes the Microsoft.Toolkit.Wpf.UI.Controls package, I get the following error:
NETSDK1135 SupportedOSPlatformVersion 10.0.18362.0 cannot be higher than TargetPlatformVersion 7.0. WpfApp1 C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 185

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a new project based on the WPF App (.NET) template.
  2. Add to the project the Microsoft.Toolkit.Wpf.UI.Controls NuGet package.
  3. Compile the solution.
  4. See error

Expected behavior

I should be able to successfully compile a .Net 5.0 project that includes the Microsoft.Toolkit.Wpf.UI.Controls package.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

NuGet Package(s): 
Microsoft.Toolkit.Wpf.UI.Controls

Package Version(s): 
6.1.2

Project .NET Version:
- [ ] .NET Framework (version: )
- [ ] .NET Core 3
- [ ] .NET Core 3.1 Preview (version: )

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [X] 2019 (version: 16.8.0) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

@matthew25187 matthew25187 added the bug 🐛 Something isn't working label Nov 26, 2020
@ghost ghost added the needs triage 🔍 label Nov 26, 2020
@ghost
Copy link

ghost commented Nov 26, 2020

Hello matthew25187, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@pcfulife
Copy link

pcfulife commented Dec 6, 2020

Adding SupportedOSPlatformVersion 7.0 into your csproj file as message will remove this error.
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>

But, it will show another error message that you should use cswinrt to use WinRT API in .NET 5

@r-work
Copy link

r-work commented Dec 8, 2020

Same issue here.

@JensNordenbro
Copy link

Same on Winforms

@nesherhh
Copy link

Why is this issue closed? I don't use WebView2. I need MapControl.

@JaykeBird
Copy link

I honestly don't understand why this was closed either. I encountered this issue while using the InkCanvas and InkToolbar.

I was hoping to test out XAML Islands alongside the Windows 10 APIs being easily accessible when using .NET 5 at the same time.

@michael-hawker
Copy link
Member

@nesherhh @JaykeBird sorry, I misread and didn't realize this was for the root package and not the WebView package and triaged incorrectly. I've re-opened the issue.

FYI @marb2000 @ocalvo.

@CommunityToolkit CommunityToolkit deleted a comment Jan 20, 2021
@CommunityToolkit CommunityToolkit deleted a comment Jan 20, 2021
@deanchalk
Copy link

I have the same issue. I have a large WPF app that I have been migrating to .NET 5. The migration is now complete. This morning me and my team are going to be re-writing some of our WPF/C# custom controls into C++/WinRT controls and hosting them in XMAL islands.
As soon as I add the Microsoft.Toolkit.Wpf.UI.XamlHost nuget package and build I get this visual studio error:

Error NETSDK1135 SupportedOSPlatformVersion 10.0.18362.0 cannot be higher than TargetPlatformVersion 7.0. Gordon.UI.WPF C:\Program Files\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 185

@marb2000
Copy link
Contributor

Unfortunately system XAML Islands doesn't work with .NET 5. .NET 3 Core included built-in WinRT projections, but .NET doesn't. The WinUI 3 version of XAML Islands will support .NET 5, however it's still in development, no ETA yet.

@marb2000 marb2000 added feature request 📬 WinUI3_revisit This issue should be revisited when WinUI 3 Islands is available and removed bug 🐛 Something isn't working labels Jan 20, 2021
@marb2000
Copy link
Contributor

I have removed the bug tag (it's not a bug, it's by design) and I added the feature request for WinUI 3.

@Noemata
Copy link

Noemata commented Jan 21, 2021

@marb2000 and @michael-hawker, it's kind of astonishing that XAML Islands are not being supported in .Net 5 and that this "is by design". Why bother with the WPF modernization saga if the real intent was to switch to WinUI? @deanchalk had a reasonable expectation that XAML Islands would be carried forward to .Net 5. There was no messaging suggesting otherwise.

Strange.

@Philip-S-Martin
Copy link

@Noemata Windows UI on some release 3.x (I presume this will be roughly in sync with .NET 6 release) will support WPF, WinForms, and XAML Islands. I imagine they've had to go through a lot of rearchitecture to get this to work, so it makes sense.

https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/roadmap.md

@Noemata
Copy link

Noemata commented Jan 21, 2021

I accepted the deemphasis WPF when UWP was being heralded. It's gotten progressively harder to accept the choices being made by Microsoft. Some of these choices would be easier to swallow if some concessions were made about past mistakes, reducing the likelihood of repeats. Anyhow, I'll stop whining for the rest of this year and try to be part of the solution rather than part of the problem. If December roles around and XAML land is still unsettled, I'll crawl out from under the rock again.

Here's the source material for XAML Islands v2:

"What is your roadmap for XAML Islands v2?
XAML Islands v2 is intended to ship as a part of WinUI 3.0. Therefore, v2 will support the same Windows 10 versions as WinUI 3.0. We are planning to release v3 major release of WinUI during the first half of 2020. WinUI is an open source project, and you can follow the latest roadmap and news at: https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/roadmap.md"

https://blogs.windows.com/windowsdeveloper/2019/06/13/xaml-islands-v1-updates-and-roadmap/

When I read this it sounded like .Net 5 would have this. Seems like too many eggs are being put in the WinUI basket.

@marb2000
Copy link
Contributor

The blog post is out of date. Too many things happened between this blog post and today (including the pandemic).

Some clarifications.

  • We announced through various channels that the XAML system, the XAML that comes with the Windows 10 operating system and uses the Windows.UI.XAML namespace, will no longer be updated (including XAML Islands v1). We moved all of our efforts to WinUI 3 (and WinUI 2.x).
  • WinUI 3 uses .NET 5 (no backward compatibility of .NET 3 Core) and will be upgraded to .NET 6 when .NET 6 reaches GA.
  • WinUI 3 is a re-architecture of the whole platform that requires redoing many parts to eliminate the dependencies of the operating system. Also, WinUI 3 requires decoupling the platform from UWP and making it work on Win32 (in addition to UWP). This will better integrate XAML with Win32 applications; therefore, we will have a much better experience in the XAML islands.

We know that it is frustrating when some technologies advance at a pace, like .NET, and others do not do it in time. But this effort that the team (WinUI 3) is making, in sync with other partners such as .NET and Visual Studio, is to solve this problem (and others). For having an alignment between all these technologies and updating at a similar rate.

@Noemata
Copy link

Noemata commented Jan 21, 2021

@marb2000, thanks for the clarification. The roadmap here: https://github.com/microsoft/microsoft-ui-xaml/blob/master/docs/roadmap.md

Needs clarification as well. It's not obvious that XAML Islands go away with the initial introduction of .Net 5 and will reappear post WinUI 3.x release. Having information about the impact of the .Net Native compiler going away would be helpful so we know how tooling and deployments are affected (secured). Likewise for some other bits that re going away. It would help to mention WPF and where it fits in with WinUI. WPF devs might again feel deemphasized by this chart. Not a good thing given a lot of WPF positives were initiated by Microsoft of late.

As you know tech going in and out of scope diminishes confidence and complicates planning. If Microsoft gives us an honest, complete and sober expression of direction we'll all be better off. I very much appreciate all the work you're doing @marb2000.

I carefully track what you're up to. You're one of the UWP stars at Microsoft! It's been sad to see some of the changes within the team.

@marb2000
Copy link
Contributor

Thanks @Noemata I opened a internal conversation about whether we should accelerate the support of XAML Islands for WinUI 3. It was moved to 2022 but let's see if we can create a solid engineering plan to support it in 2021. This will enable that WPF and WinForms .NET 5 apps can host WinUI 3 controls.

About using .NET 5 instead .NET Native for UWP WinUI 3 apps, we understand your concerns about perf and security, but .NET team is very confident about offering something as good as .NET Native with the steady perf improvements that they are doing in each release of .NET. I believe on them. They are the experts. 😊

@Noemata
Copy link

Noemata commented Jan 26, 2021

@marb2000 , you've answered all of my questions here and elsewhere. I think I've got the full picture now, to the extent I need it for my decision making. Thank you.

@nesherhh
Copy link

I have started porting XAML Islands to .NET 5 - https://github.com/nesherhh/XamlIslandsNET5

@michael-hawker
Copy link
Member

I have started porting XAML Islands to .NET 5 - https://github.com/nesherhh/XamlIslandsNET5

Thanks for letting us know, FYI @marb2000.

Just curious why you didn't fork the repo to start and maintain history & comparison of your changes from this base?

@nesherhh
Copy link

nesherhh commented Sep 14, 2021

It is a part of my pet project. I have removed many projects because I need just the MapControl.
Should I fork instead? Is it possible after cloning first?

@michael-hawker
Copy link
Member

Should I fork instead? Is it possible after cloning first?

I'm not sure about that, you may need to fork it, and then from your local repo you could add that as an origin and try and rebase all your changes on-top of the repo without the removals.

At this point, just keep us posted on how your project goes, and we'll see if we hear back from the WinUI folks if they have interest. They're pretty heads down on getting WinUI 3 out the door at the moment, so it may take them a bit to get back to us.

Thanks!

@pcfulife
Copy link

Is it in a progress?

@duckfist
Copy link

duckfist commented May 9, 2022

Is this dead, years later? Can we still not use WinRT controls in a .NET 5.0 WPF desktop app? I'm really questioning the future of WPF, this is all so incredibly confusing, I can't tell the difference between all of these slightly overlapping paradigms anymore, WPF/WinRT/UWP/WinUI, it's all so horribly confusing.

@Dev-Taehui
Copy link

PLEASE SHARE XAML ISLANDS DEV PROGRESS!!!

@boppbo
Copy link

boppbo commented Mar 15, 2023

@Dev-Taehui I think they are blocked by upstream: microsoft/microsoft-ui-xaml#7104

@michael-hawker
Copy link
Member

Islands was mentioned by the platform team in the community call here last month: https://www.youtube.com/live/xcgc5CLqUkM?feature=share&t=2997

That is the path forward, so watch the Windows App SDK for updates. Haven't had a chance to watch the call from today, so not sure if any update was provided.

@Dev-Taehui
Copy link

@boppbo @michael-hawker The app I created relies entirely on XamlIsland, so I was very nervous because I had no news of XamlIsland. I apologize for my aggressive behavior. I've seen the video, but I missed the part about XamlIsland.

Fortunately, I'm relieved that it's developing well internally. I hope the preview version comes out soon.

@michael-hawker
Copy link
Member

@Dev-Taehui appreciate you calling that out. I understand there's a lot of changes happening at the moment and it can be frustrating. I know the platform team is working really hard on moving things forward as best they can.

We too have been waiting for it to leave experimental releases so we can better close this repo and point folks to their new home. Hopefully, we'll have more ideas of when that might be in the next few months from future updates from the platform team.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request 📬 WinUI3_revisit This issue should be revisited when WinUI 3 Islands is available XamlIslands 🏝️
Projects
None yet
Development

No branches or pull requests