Is it possible to make desktop GUI application in .NET Core?

后端 未结 15 1791
我在风中等你
我在风中等你 2020-12-12 11:02

I have been developing Windows Forms 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.

15条回答
  •  轮回少年
    2020-12-12 11:12

    Yes, it is possible.

    .NET Core doesn't have any components for native GUI application out of the box. However, there is a NuGet package for it that is called Electron.NET, as per Gregor Biswanger's answer.

    Electron is a framework that allows you to build native GUI applications on top of Node.js. Electron.NET is a NuGet package that allows you to utilise Electron and Node.js from within your .NET Core code.

    The good news is that you don't have to learn JavaScript, Electron or Node.js in order to be able to use the NuGet package. JS files do run inside your application, but they get automatically generated by the build process.

    All you do is build a pretty standard ASP.NET Core MVC app. The only difference is that, instead of running in the browser, it runs as a native windowed app. Besides just a few lines of code specific to the Electron.NET package, you won't need to learn anything above ASP.NET Core MVC.

    This page provides a tutorial on how to use it. It also contains some links to sample code repositories.

提交回复
热议问题