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 Issues

[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

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)

[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.

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.