❔ developing wpf on linux using jetbrains rider

hello everyone 🙂 noob here trying to follow along with the examples in this book i'm reading(head first c#) it has steps on how to change the xaml for a windows desktop app using wpf option in vs code. but i'm on jetbrains rider on linux is this no possible? i tried doing settings -> file templates -> xaml -> resource dictionary using the instructions in this page: https://www.jetbrains.com/help/rider/Settings_Tools_XAML_Preview.html and then hitting on save but i don't know if it worked, coz when i do a 'new solution' it doesn't have the option for wpf forms. or is just a file it's creating? coz i also can't find it
JetBrains Rider Help
XAML Preview | JetBrains Rider
29 Replies
ZacharyPatten
ZacharyPatten2y ago
WPF is not cross platform. WPF is only supported on Windows. You can write code for it from linux, but you won't be able to run it on linux. as for what features are in JetBrains Rider... sorry can't help with that. I don't use Rider. Hopefully someone else will chime in
arion
arion2y ago
The WPF option should be under "Desktop Application" on the ".NET / .NET Core" category (not .NET Framework)
arion
arion2y ago
I don't know it it displays on linux tho
bregue dhue
bregue dhueOP2y ago
ty for all the insight guys i don't mind, i'm sure i can run the actual binary with wine or something but the solution template to start from is what i need, as you say i can write it probably, and as long as it compiles getting it to run should be easy enough
bregue dhue
bregue dhueOP2y ago
yeah you have way more options there mine is like this
bregue dhue
bregue dhueOP2y ago
did you have to do something to get those options?
arion
arion2y ago
hmm, what dotnet versions do you have installed? (You can head over to Console application to check under Framework or SDK
bregue dhue
bregue dhueOP2y ago
under core the highest available it says is 7.0 and under framework it says 4.8
bregue dhue
bregue dhueOP2y ago
arion
arion2y ago
hmm, maybe we can init it via the cli then just open it in rider?
bregue dhue
bregue dhueOP2y ago
how do you do that?
arion
arion2y ago
do you get an error when creating a project in dotnet new wpf (remember to change to a respective working directory (like /home/pum/RiderProjects/head_first_c-sharp/)) dotnet new sln dotnet sln add head_first_c-sharp.csproj
bregue dhue
bregue dhueOP2y ago
$ dotnet new wpf
No templates or subcommands found matching: 'wpf'.
Did you mean one of the following templates?
dotnet new web

To list installed templates similar to 'wpf', run:
dotnet new list wpf
To search for the templates on NuGet.org, run:
dotnet new search wpf


For details on the exit code, refer to https://aka.ms/templating-exit-codes#103
$ dotnet new wpf
No templates or subcommands found matching: 'wpf'.
Did you mean one of the following templates?
dotnet new web

To list installed templates similar to 'wpf', run:
dotnet new list wpf
To search for the templates on NuGet.org, run:
dotnet new search wpf


For details on the exit code, refer to https://aka.ms/templating-exit-codes#103
$ dotnet new sln
The template "Solution File" was created successfully.
$ dotnet new sln
The template "Solution File" was created successfully.
wait i might have done the last two commands you sent wrong from where am i supposed to run it? check this out though
$ dotnet new install "WPF template"
The following template packages will be installed:
WPF template

WPF template is not supported.

For details on the exit code, refer to https://aka.ms/templating-exit-codes#106
$ dotnet new install "WPF template"
The following template packages will be installed:
WPF template

WPF template is not supported.

For details on the exit code, refer to https://aka.ms/templating-exit-codes#106
arion
arion2y ago
yea, i just tested the same in wsl and got that same error, it looks like wpf isnt included as a template on linux
bregue dhue
bregue dhueOP2y ago
can i download it maybe? install it somehow?
arion
arion2y ago
doesnt look like it, tho alternatives to wpf can be Avalonia (which is similar but not exactly xaml code)
bregue dhue
bregue dhueOP2y ago
dammit microsoft ty though
arion
arion2y ago
what i could find on the topic:
arion
arion2y ago
people were having similar issues, and no luck
bregue dhue
bregue dhueOP2y ago
interesting welp
Angius
Angius2y ago
Just use Avalonia It's basically WPF 2.0, and fully x-plat
arion
arion2y ago
regarding this
$ dotnet new sln
The template "Solution File" was created successfully.
You can delete that now it should be something like head_first_c-sharp.slnthis also has Avalonia specific support (https://docs.avaloniaui.net/docs/next/get-started/set-up-an-editor#jetbrains-rider)
Arch Leaders
Arch Leaders2y ago
Was coming here to say just that, glad somebody said it xD
jcotton42
jcotton422y ago
I'm pretty sure Wine can't run WPF
⠋ Sewer56 ⣠
Wine could run WPF for years. I have end users that have been for a good 3 years. I do suggest just using Avalonia though
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server