29
submitted 7 months ago* (last edited 7 months ago) by nope@jlai.lu to c/programming@programming.dev

Hi Lemmings, I wondered if anyone had successfully created a C# project that uses winforms on linux.
I just can't figure out how to do it.
I use Arch and have full dotnet 6 and 8 packages; but I can't dotnet new winforms as the template seems to not exist.
I also have installed mono and monodevelop installed, but even the simplest solution (Console App) can't load correctly (currently I have /usr/share/dotnet/sdk/8.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(152,5) : error MSB4062: The "CheckForImplicitPackageReferenceOverrides" task could not be loaded from the assembly /usr/share/dotnet/sdk/8.0.102/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks.dll. Invalid Image Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. but there were different similar errors before, these errors.
I don't really want to boot up a VM every time I have to code on that project, but I'm starting to feel desperate about this.

TLDR: How does one create and work on a WinForms C# project with linux ? Any suggestions are welcome

Some clarifications for future readers :

  • It is for a school group project; winforms in imposed, which sadly won't let me go with Avalonia
you are viewing a single comment's thread
view the rest of the comments
[-] agressivelyPassive@feddit.de 6 points 7 months ago

The "Win" in Winforms stands for Windows, capital W. It's simply not available for Linux.

[-] cbarrick@lemmy.world 15 points 7 months ago

Mono has some docs that imply they have implemented WinForms on X11.

https://www.mono-project.com/docs/gui/winforms/

[-] breadsmasher@lemmy.world 10 points 7 months ago

From the FAQ

A small driver is required for each operating system supported. Currently we have drivers for: X Window System Win32 Window System macOS Window System

so I think you’re right

[-] Kissaki@programming.dev -4 points 7 months ago

Official source (emphasis mine)

Welcome to the Desktop Guide for Windows Forms, a UI framework that creates rich desktop client apps for Windows.

[-] cbarrick@lemmy.world 1 points 7 months ago* (last edited 7 months ago)

Of course Microsoft implemented it "for Windows".

The Mono project implements many of the .Net APIs in a portable way for other operating systems, including an implementation of WinForms on X11.

OP specifically mentioned that they were using Mono.

this post was submitted on 16 Mar 2024
29 points (100.0% liked)

Programming

17351 readers
253 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS