Windowstemplatestudio: Compilation issue in the Windows Template Studio WPF .NET Core application

Created on 29 Dec 2020  路  3Comments  路  Source: microsoft/WindowsTemplateStudio

Hi,

I have created the WPF .NET Core application with below configuration,

Project type : Navigation pane
Design pattern : Code Behind
Pages : All
Features : All
Services : Optional

Then, I have just change the target framework version as .NET 5.0 from .NET Core 3.1 and I have faced the below issue when compile the application.

image

I have followed the below link to fix this issue, but after change the project file as per suggestion from the below link, I have faced the below issues.

https://stackoverflow.com/questions/65028532/netsdk1135supportedosplatformversion-10-0-19041-0-cannot-be-higher-than-targetp/65044923#65044923

image

I have faced issues one by one after clear every issues. but I can't fix the last issue from my side. If I remove the NuGet packages which is suggested in the above link the above last issue is not reproduced. But I have faced the first issue. I can't use the WPF Core application for the .NET 5.0 with choose all the pages and features.

Could you please suggest me to resolve this issue for the .NET 5.0 application?

Regards,
Ganesan R.

bug needs-triage

Most helpful comment

The files you have having issue with are related to XAML Islands. XAML Islands are not supported in apps that target .NET 5

XAML Islands are supported only in apps that target .NET Core 3.x.

[[source](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands#limitations-and-workarounds)]

It you're not using XAML Islands (or WebView) then you can modify the project to target 5.0 but there is no guarantee that the all generated to target 3.1 will work in 5.0.

There is a separate issues (#4020) for changing the WPF templates to target .NET5 and I'll update that with more information.

All 3 comments

Could you please check and suggest the solution on this?

The files you have having issue with are related to XAML Islands. XAML Islands are not supported in apps that target .NET 5

XAML Islands are supported only in apps that target .NET Core 3.x.

[[source](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands#limitations-and-workarounds)]

It you're not using XAML Islands (or WebView) then you can modify the project to target 5.0 but there is no guarantee that the all generated to target 3.1 will work in 5.0.

There is a separate issues (#4020) for changing the WPF templates to target .NET5 and I'll update that with more information.

@ganesanviji, I'm going to close this issue. As @mrlacey stated XamlIsland and WebView are not supported in .NET 5.
Please reopen if you find problems with porting an app without XamlIsland and WebView to .NET 5.

Was this page helpful?
0 / 5 - 0 ratings