-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
.NET 5 - dotnet tool support for WinForms applications targeting net5.0-windows #16361
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@marcpopMSFT I have the same issue when multi-targeting a console application with I am very confused about this considering that |
@wli3 do we have this limitation documented anywhere outside of the error message? |
Any suggestion to make the error message better? At this point, anything net5.0-windows will not be supported. And there is no easy way to pack only one specific TFM to tools. The root cause is #12055 |
I think the error message is quite alright. The "also" of the WPF/WinForms message is quite correct, but I overread it the first time. Independent of the error message, it is the mismatch against the expectations which is the problem 😀. We see a CLI parameter and think we can just pack it like a regular multi-target NuGet. |
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. dotnet/sdk#16361
dotnet PackAsTool is busted since dotnet 5.0 if using windowsforms or wpf (though I definitely had it working with dotnet 7). Not sure the right way to do this, I don't like bringing in windowsforms just to get screen resolution and offsets but i've already spent way too long trying to find another way and there doesn't seem to be one. maybe wmi/cim would work, but i couldn't find if it can report the offsets necessary for ffmpeg to record the screen correctly. I think this workaround basically lies to packastool when it does its check. doesn't seem to have any impact on if it works or not at runtime. see dotnet/sdk#16361 and dotnet/sdk#12055
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!
The text was updated successfully, but these errors were encountered: