GithubHelp home page GithubHelp logo

congzhangzh / desktoploveblazorweb Goto Github PK

View Code? Open in Web Editor NEW
58.0 8.0 12.0 2.44 MB

A cross-platform desktop application template (mobile support in the future) based on Blazor Server, which uses an in-process ASP.NET Core server + in-process OS WebView component.

HTML 33.24% C# 48.03% CSS 18.73%
dotnet cross-platform cross-platform-gui blazor-server single-file-exe hybrid-application

desktoploveblazorweb's Introduction

What this Project try to do

Find a solution to mix the best part of .net for desktop application

  1. Work with dotnet and get all the benefits of its improvement like

    1. The best c# language
    2. The great Dotnet Framework Library
    3. SingleFile Deploy mode
    4. Cross platform
  2. Use asp.net's modern UI technology like Blazor to release the productivity for frontend development

  3. Easily cross-platform, support Windows/Linux/Mac OSX seamlessly

  4. Follow upstream of photino.NET

  5. Focus on Latest Blazor&Dotnet version

Background

My teams are all C# boys, we want to use web technology and migration some old style internal desktop application which develop by MFC/WINFORM/WPF, we can not simple use webassembly and PWA, as these software is really desktop style, and pack and run on customer computer, we can not deliver it by webserver/CDN and so on.

The struct of the application

  1. asp.net run in the process
  2. in process browser to show the server content
    1. [Photino/WebWindows][prefer] (use https://github.com/tryphotino/photino.NET)
    2. [webview] (use https://github.com/webview/webview_csharp)

A Demo

Why

Because Microsft create much great technology, but this giant is also always a work in progress, As the developer, we can just choose the most solid and stable part, that's it.

As Microsoft will never stop its step for some corner requirement, this just cares about the big future, that's why many developers hate it or like it, and for us, we just choose the best part of it so solve the current problem first.

So, dotnet+cross platform browser+great blazor technology.

Some word to friends who use old UI technology on Microsoft stack

From Win32/MFC/WinForm/WPF/...to Blazor, I think Blazor is value to try, as this new style base on virtual dom/increment dom like idea is really change the UI coding style and greatly improve the productively, one month's work can be done in on week now, that's really great

Reference

  1. hope MobileBlazorBindings support fixed version deploy mode dotnet/MobileBlazorBindings#202
  2. hope webview/webview_csharp can support webview2 fixed version deploy mode webview/webview_csharp#4 webview/webview#493
  3. some talk from v2ex.com https://s.v2ex.com/t/720460
  4. maybe solve the problem of webview/webview_csharp#4
  5. a very promise blazor UI libray https://github.com/ant-design-blazor/ant-design-blazor
  6. chromium base edge will be part of windows https://techcommunity.microsoft.com/t5/microsoft-365-blog/new-microsoft-edge-to-replace-microsoft-edge-legacy-with-april-s/ba-p/2114224
  7. reddit talk https://www.reddit.com/r/Blazor/comments/lw9prg/will_you_use_net_blazor_for_desktop_application/
  8. awesome balzor https://github.com/AdrienTorris/awesome-blazor
  9. awesome dotnet core https://github.com/thangchung/awesome-dotnet-core

desktoploveblazorweb's People

Contributors

congzhangzh avatar gismofx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktoploveblazorweb's Issues

[free time to do] add multi run mode like Pure Server Mode/Maui Blazor and even Gtk、WPF support

Why

Easy debug, or sometimes another mode fit to you

How

Pure Server Mode

Start as Normal Blazor Server, this is really easy to debug

Maui/photino.Blazor

This should solve some problems like cross UI thread problem which Blazor Server involves ( should possible be fixed on adjusting asp.net core task scheduled module)
as the asp.net team split out WebView requirements, depending on MAUI is not essential。

https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView/
https://github.com/tryphotino/photino.Blazor/blob/master/README.md

Mix in WPF/Gtk

Sometimes's temporary depend on OS native part make your work easy, the challenge may be something like mixing event loop and using the same synchronize dispatcher

Access Inspector on MacOS?

Hey, I submitted an issue here webview/webview#529 and wondering if you have the same trouble with accessing the webview/webkit inspector on MacOS.

My project is using MudBlazor for UI and It's doing some funny things when rendering. No issue on Windows, only Mac.

System.Runtime.InteropServices.SEHException: 'External component has thrown an exception.'

@congzhangzh Thanks for putting this together. I forked your repo and tried to run the project, no changes, and I get an error when running the project, I think from webviewsharp. It throws the error here:

using var webview = new Webview(); in Program.cs on line 57.

StackTrace " at SharpWebview.Bindings.webview_create(Int32 debug, IntPtr window)\r\n at SharpWebview.Webview..ctor(Boolean debug, Boolean interceptExternalLinks)\r\n at BlazorBrowserNativeStyle.Program.OpenInLine(String address)

[design] mix ui thread and asp.net server thread

I found the limitation of this design, ui cross thread problem!

as asp.net run in separate thread which is not STA.

maybe we can mix all run one STA thread event loop.

for example, when mix a WPF control in win32 window, there is no need and should not start a new ui thread for it, it just work.

If it can not be solved, this project should stop, and the user should migrate to maui, even just for blazor.

Unable to run on Linux

I tried to run the sample project on Linux (latest Kubuntu LTS) and I get the following exception:

Unable to load shared library 'Photino.Native' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libPhotino.Native: cannot open shared object file: No such file or directory
   at PhotinoNET.PhotinoWindow.Photino_ctor(PhotinoNativeParameters& parameters)
   at PhotinoNET.PhotinoWindow.<WaitForClose>b__229_0()
   at PhotinoNET.PhotinoWindow.Invoke(Action workItem)
   at PhotinoNET.PhotinoWindow.WaitForClose()
Error #0
Unhandled exception. System.AggregateException: One or more errors occurred. (Native code exception. Error # 0  See inner exception for details.)
 ---> System.ApplicationException: Native code exception. Error # 0  See inner exception for details.
 ---> System.DllNotFoundException: Unable to load shared library 'Photino.Native' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libPhotino.Native: cannot open shared object file: No such file or directory
   at PhotinoNET.PhotinoWindow.Photino_ctor(PhotinoNativeParameters& parameters)
   at PhotinoNET.PhotinoWindow.<WaitForClose>b__229_0()
   at PhotinoNET.PhotinoWindow.Invoke(Action workItem)
   at PhotinoNET.PhotinoWindow.WaitForClose()
   --- End of inner exception stack trace ---
   at PhotinoNET.PhotinoWindow.WaitForClose()
   at BlazorBrowserNativeStyle.Program.OpenInLine(String address) in /home/manfredi/Scrivania/desktoploveblazorweb/BlazorBrowserNativeStyle/Program.cs:line 110
   at BlazorBrowserNativeStyle.Program.MainImpl(String[] args) in /home/manfredi/Scrivania/desktoploveblazorweb/BlazorBrowserNativeStyle/Program.cs:line 57
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at BlazorBrowserNativeStyle.Program.Main(String[] args) in /home/manfredi/Scrivania/desktoploveblazorweb/BlazorBrowserNativeStyle/Program.cs:line 26

The dotnet build command is successful, the exception only occurs when running.
Everything works fine on Windows instead.

MacOS UI Empty/No Display

I just want to document/capture this in a separate issue.

If webview_sharp is cross platform, why does this example not work on MacOS?

Have you successfully tried the webview_sharp examples on MacOS?
Webview Sharp examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.