Skip to content
Create Cross-Platform GUI Applications using ASP.NET Core 2.2
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

License Shield AppVeyor Travis CircleCI

Create Cross-Platform GUI Applications

Use ASP.NET Core 2.2 and host it locally into a frontend like e.g. Electron

Why screw around with Qt or JavaFX if you can just design your client app as if it were a website and bridge it with a locally hosted ASP.NET Core C# backend?

Not only is it better in terms of separation of concerns (because your frontend only receives the data it needs from the backend for presentation), you also have the choice of running the app in the user's browser of choice (like pgAdmin 4 does) or serve it in the background while some lightweight web view wrapper app displays the localhost site in its window.

When you run the application, the included mkcert build will automatically deploy HTTPS certificates to the wwwroot/ssl folder on startup (check out the Program entry point class for more information). When opened in the browser, HTTPS should work out-of-the-box. When running in the background, depending on what frontend you use you might need to do some adjustments to get the SSL certificates to work.

To do:

  • Once you forked the repo, use the IDE of your choice to rename the project to your desired application name.
    • Don't forget to also rename the namespace to match your new name.
  • Open Program.cs and decide if the default setup with the #defines at the top of the file suits your needs.
  • Localization is provided using the default ASP.NET Core approach.
    • To localize your views, just add the corresponding Views.ControllerName.ActionName.CULTURE_SPECIFIER.resx file to Resources/.
      • Culture specifiers are usually two lowercase letters; e.g. de, it, etc...
    • Update the supported cultures array inside Startup.cs to reflect the languages you want to support.
    • You can also use the Layout dummy class to localize strings generally (inside the corresponding Views.Shared._Layout.CULTURE_SPECIFIER.resx file). In this case, @inject IStringLocalizer<Layout> into your cshtml views.
  • Document your code using appropriate xml docs.
  • To build the API documentation, execute the included build-docs.bat on Windows (or on Linux/macOS respectively). You need to have DocFX installed on your computer for this. The compiled documentation site should then be available to serve (e.g. via pages) inside the docs/ directory.

  • Now you can activate your AppVeyor, CircleCI and Travis Continuous Integration services and make them point to your repo; they will run the unit tests inside tests/ and update the build status accordingly.
    • Change the build status badge URLs to point to your CI setup at the top of this readme file.
You can’t perform that action at this time.