I have been developing WinForms programs for few years. I am now looking into .NET Core (including ASP.NET Core MVC). I am searching for the new GUI desktop technology. In Visual Studio 2015 update 3 I can't see any option to make a GUI app in .NET Core. What am I missing?
相关问题
- Dotnet Core API - Get the URL of a controller meth
- Why am I unable to run dotnet tool install --globa
- Singleton with AsyncLocal vs Scope Service
- What would prevent code running in a Docker contai
- .NET Core gives unknown error while processing HTT
相关文章
- DotNet Core console app: An assembly specified in
- EF Core 'another instance is already being tra
- Re-target .NET Core to net471, net 472
- Publishing a Self-contained Console app fails
- Calling a .Net Framework 4 (or Mono) assembly from
- Can't get deleted items from OpenLDAP Server u
- proper way to sign .net core assembly
- Should I cache and reuse HttpClient created from H
Necromancing.
For the special case of existing WinForms applications:
There is a way - though I don't know how well it works.
It goes like this:
Take the WinForms implementation from mono.
Port it to .NET Core or NetStandard.
Recompile your WinForms applications against the new System.Windows.Forms.
Fix anything that may be broken by NetCore.
Pray that mono implements the parts you need flawlessly.
(if it doesn't, you can always stop praying, and send the mono-project a pull request with your fix/patch/feature)
Here's my CoreFX WinForms repo:
https://github.com/ststeiger/System.CoreFX.Forms
we coded an open source solution for electron with .net core: Electron.NET. https://github.com/ElectronNET/Electron.NET
Enjoy!
tl;dr - I'm not sure that it would be possible for the .NET Core devs to supply a cross platform GUI framework.
I feel like expecting a cross platform GUI framework to be bundled into the official tooling (especially an old version of the tooling - you mention that you're running VS 2015 update 3) for an early version of .NET Core is a little premature.
GUI frameworks are really quite heavy, and dependant on the hardware abstractions already present on the host machine. On Windows there is generally a single window manager (WM) and desktop environment (DE) used by most users, but on the many different distributions of Linux which are supported, there are any number of possible WMs and DEs - granted most users will either be using X-Server or Wayland in combination with KDE, Gnome or XFCE. But no ever Linux installation is the same.
The fact that the open source community can't really settle on a "standard" setup for a VM and DE means that it would be pretty difficult for the .NET Core devs to create a GUI framework which would work across all platforms and combinations of DEs and WMs.
A lot of folks here have some great suggestions (from use ASP.NET Core to builds a Web application and use a browser to listing a bunch of cross platform frameworks). If you take a look at some of the mentioned cross platform GUI frameworks listed, you'll see how heavy they are.
However, there is light at the end of the tunnel as Miguel de Icaza showed off Xamarin running naively on Linux and MacOS at .NET Conf this year (2017, if you're reading this in the future), so it might be worth trying that when it's ready.
(but you'll need to upgrade from VS 2015 to VS 2017 to access the .NET Core 2.0 features)
AvaloniaUI now has support for running on top of .NET Core on Win/OSX/Linux. XAML, bindings and control templates included.
e.g. to develop on MacOs with Rider:
New Solution
-> (Near the top of the Templates List) ->More Templates
-> ButtonInstall Template...
-> browse to the directory where you cloned the templates at step 1.Reload
ButtonNew Solution
Templates List!You could develop a web application with .NET Core and MVC and encapsulate it in a Windows universal JavaScript app : https://docs.microsoft.com/en-us/windows/uwp/porting/hwa-create-windows
It is still a web app but it's a very lightweight way to transform a web app into a desktop app without learning a new framework or/and redevelop the UI, and it works great.
The inconvenience is unlike electron or ReactXP for example, the result is a universal Windows app and not a cross platform desktop app.
It's an old question, but yes, it is possible to develop cross-platform desktop (GUI) applications, for Windows, Linux and macOS, using VSCode, .Net Core, C#, gtk3, gtksharp and Glade as GUI Designer.
Here is how.