Skip to content

.NET 5 - dotnet tool support for WinForms applications targeting net5.0-windows #16361

Open
@guidemetothemoon

Description

@guidemetothemoon

Hello.

I have a question regarding dotnet tool supprot for WinForms applications: we have been planning to lift our .NET Core 3.1 Windows Forms applications that are now being packaged as dotnet tools to .NET 5 but this will mean that the target framework for those applications will be .net5.0-windows.

The problem is then that we will not be able to package those apps as dotnet tools anymore, ref. following error message coming from the build pipeline:
C:\Program Files\dotnet\sdk\5.0.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.PackTool.targets(95,5): error NETSDK1146: PackAsTool does not support TargetPlatformIdentifier being set. For example, TargetFramework cannot be net5.0-windows, only net5.0. PackAsTool also does not support UseWPF or UseWindowsForms when targeting .NET 5 and higher.

Unfortunately I'm not able to find more detailed information or any documentation saying that it's not supported and what alternative approaches are recommended.
Can someone please clarify this for me?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions