Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinUI 3.0 Alpha (February 2020) w/ WebView2 πŸš€πŸ‘©β€πŸ’»πŸŽ‰ #1965

Closed
adambarlow opened this issue Feb 11, 2020 · 33 comments
Assignees
Labels
discussion General discussion

Comments

@adambarlow
Copy link
Contributor

adambarlow commented Feb 11, 2020

WinUI 3.0 Alpha (February 2020) w/ WebView2

As mentioned in the recent community call we now have a WinUI 3.0 Alpha available w/ Chromium-based Microsoft Edge WebView2!

Please note that WinUI 3.0 Alpha is a very early prerelease and has lots of known issues and missing functionality, so it isn't ready for production apps. Future previews and the first stable version of WinUI 3 in 2020 will add support for everything outlined in the roadmap.

In particular if you don't see an API in the WebView2 API spec and it is existing functionality of the current WebView, it is likely planned to be included on the base WinRT object, whose API is likely to closely match the current ICoreWebView2 interface.

Feedback on WebView2 can be posted as comments to this issue or alternatively on the WebView2 proposal.

Installation info

For installation info and known issues see:

WinUI 3.0 Alpha (February 2020)

There's a super-short survey with the download link - we'd love to know more about how you're interested in using WinUI.

Please try out the Alpha, let us know what you think and open issues if you run into any bugs that aren't listed already!

What's next?

As outlined in the roadmap we're hard at work getting WinUI ready for open source development, plus working toward a more complete preview, .NET 5 support, and more!

@adambarlow adambarlow added hot discussion General discussion labels Feb 11, 2020
@adambarlow adambarlow self-assigned this Feb 11, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Feb 11, 2020
@jesbis jesbis pinned this issue Feb 11, 2020
@jesbis jesbis removed the needs-triage Issue needs to be triaged by the area owners label Feb 11, 2020
@weitzhandler
Copy link
Contributor

Are .NET Core 3, C#8 and there newer csproj type ready?

@mdtauk
Copy link
Contributor

mdtauk commented Feb 11, 2020

Is WebView2 the only change, is there a fuller changelog available somewhere?

What progress is there with Win32 runtime support with WinUI 3.0 XAML UI?

@adambarlow
Copy link
Contributor Author

adambarlow commented Feb 11, 2020

@mdtauk Good question.

The Feb 2020 alpha refresh includes all of the work since our last release in Nov. Although WebView2 is the biggest new feature, a number of other fixes have been made to increase stability and to prepare for open source. Progress was made on Win32 runtime support, however, it is not yet complete enough that we recommend additional self-hosting / exploring of this functionality at this point in time.

@mdtauk
Copy link
Contributor

mdtauk commented Feb 11, 2020

@mdtauk
The Feb 2020 alpha refresh includes all of the work since our last release in Nov. Although WebView2 is the biggest new feature, a number of other fixes have been made to increase stability and to prepare for open source. Progress was made on Win32 runtime support, however, it is not yet complete enough that we recommend additional self-hosting / exploring of this functionality at this point in time.

Thank you for the reply. Good to know things are happening. Once the thing has been open sourced, change logs will become the norm :)

@danzil
Copy link

danzil commented Feb 11, 2020

@weitzhandler Support for .Net 5 and SDK-style projects is not yet ready. We're currently working on this as we speak.

@nabilahmed739
Copy link

nabilahmed739 commented Feb 13, 2020

@adambarlow with WebView2 can a Progressive Web App (PWA) be installed or rather can service worker registration?
The scenario is to run a PWA application inside a WebView2 in a WPF app. As you may guess, it is a enterprise LOB app.

Reasons for not wrapping it in a UWP could be:

  • App needs to start and communicate with third party console apps or windows services (In UWP there is a restriction for such communication within the app package)
  • Install app for at system level so all users can use (Plus avoid all the UWP sideloading and remote deployment overhead)
  • Access device features like fielesystem without need for defining restricted capabilities, etc..

@vascofernandes
Copy link

vascofernandes commented Feb 26, 2020

I ma not able to run a WinUI3 UWP app with WebView2 v0.9.430.

The app just crashes.

'App2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\xmllite.dll'. 
'App2.exe' (Win32): Loaded 'C:\Users\Vasco\source\repos\App2\App2\bin\x86\Debug\AppX\WebView2Loader.dll'. 
Exception thrown at 0x75EF3DB2 (KernelBase.dll) in App2.exe: WinRT originate error - 0x8007007F : 'The specified procedure could not be found.'.
'App2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. 
'App2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profext.dll'. 
Exception thrown at 0x75EF3DB2 in App2.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0935D9E0.

https://www.nuget.org/packages/Microsoft.Web.WebView2/0.9.430

@adambarlow
Copy link
Contributor Author

@vascofernandes we did not test with this version of the WebView2 nuget package (as it wasn't released yet). Please try version 0.8.355. Also please open a new issue so we can discuss there.

@nabilahmed739 the goal is to have a WPF element as well. So you would use that element and not the WinUI version for WPF apps.

@michael-hawker
Copy link
Collaborator

@adambarlow looks like this link to the interface is 404ing now?

@azchohfi want to summarize your findings from moving the Monaco WebView wrapper over to the WebView2 alpha here?

@azchohfi
Copy link
Contributor

azchohfi commented Mar 9, 2020

PR is here:
hawkerm/monaco-editor-uwp#32

  1. A few events are missing that Monaco uses are: NewWindowRequested, DOMContentLoaded.
  2. The worst part was the missing AddWebAllowedObject method. I had to implement an equivalent system using WebMessages, promisses and async/await.
  3. There is a bug that prevented me from templating the control, since the timings for the OnApplyTemplate of the WebView2 are not correct (GetTemplateChild inside OnApplyTemplate throws an exception). I worked around it by manually creating the WebView2 control inside the custom control's Loaded event.
  4. The control doesn't support the ms-appx-web or ms-appx protocol, so I had to do this to set the UriSource:
_view.UriSource = new Uri(@"file:///" + (await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Monaco/MonacoEditor.html"))).Path);

and also changed the html files I had inside the package to point to "./" instead of "ms-appx-web:///".

@adambarlow
Copy link
Contributor Author

@azchohfi I've updated the link to the CoreWebView2 interface in the OP. Your issues 1 and are covered there and therefore should be available once we are able to dot into the CoreInterface (hopefully in the next preview release). On your issue 3, are you trying to template WebView2 or trying to use it inside the template for another control?

On #4 we plan to add support for local content it didn't make it to Alpha though. Thank you for the early feedback.

@hawkerm
Copy link

hawkerm commented Mar 10, 2020

@azchohfi @adambarlow issue 2 should be the AddRemoteObject from the core interface, eh?

@azchohfi
Copy link
Contributor

azchohfi commented Mar 10, 2020

On your issue 3, are you trying to template WebView2 or trying to use it inside the template for another control?

I'm trying to use it inside the template of another control.

@azchohfi
Copy link
Contributor

@hawkerm Yes, but I have no idea how that will be mapped to a .Net type. I don't think it will.

@adambarlow
Copy link
Contributor Author

@hawkerm yes AddRemoteObject is correct.

@JensNordenbro
Copy link

Hi!

Will the .Net5 support for WinUI3 be cross platform or Windows-only?

@weitzhandler
Copy link
Contributor

Will the .Net5 support for WinUI3 be cross platform or Windows-only?

It'll be Windows only, but you'll be able to use the Uno Platform to make your WinUI app run on Android, iOS, Mac and as a website (WASM).

@JensNordenbro
Copy link

JensNordenbro commented Apr 19, 2020

Ok!

@michael-hawker , will the .NET 5 support be able to do what follows:

  1. dotnet new winui3 // or similar, I am just guessing what the moniker will be .
  2. dotnet publish -r win-x64
  3. without having Visual Studio installed ?

Just like it is for wpf, winforms, asp.net on .net core 3.x !

That is, the .net core sdk style is used.

@michael-hawker
Copy link
Collaborator

@JensNordenbro I don't have any of those .NET 5 answers; not sure why you pinged me specifically. I maintain the Windows Community Toolkit.

Pinging @ryandemopoulos to help direct this WinUI 3 question. πŸ™‚

@JensNordenbro
Copy link

JensNordenbro commented Apr 22, 2020

Hi @michael-hawker, it was because you profil suggest you work at Microsoft. Weitzhandler who kindly answered seems to work at Uno. I hope for ryandemopoulos then.

@weitzhandler
Copy link
Contributor

@JensNordenbro lol, I don't work for either, I'm just an enthusiastic user.

@JensNordenbro
Copy link

Ok @weitzhandler ;)

I got the impression that Uno uses Xamarin.Forms underneath with som renderers for WebAssembly and that the solutions presented where tied to the full Visual Studio.

I know from before that Xamarin.Forms is possible to build using CLI-only if one omitts the Android and IOS parts. Do you know if the same applies for Uno? (It relates to my question above).

@weitzhandler
Copy link
Contributor

weitzhandler commented Apr 22, 2020

@JensNordenbro

I got the impression that Uno uses Xamarin.Forms underneath with som renderers for WebAssembly and that the solutions presented where tied to the full Visual Studio.

It doesn't. For WASM it uses Mono, for Android and iOS, it uses Xamarin.Android and Xamarin.iOS respectively.

Do you know if the same applies for Uno?

I'm sorry, I don't. I can only guess it's probably supported, because of the above, and the WASM project is an ASP.NET Core project.

And BTW, this looks like news you might find interesting.

@JensNordenbro
Copy link

Yes @weitzhandler , that could be it!

I checked out Uno, it has recently gotten "dotnet new"-templates to do what I want for webassembly targets. Although it feel to ugh to rely on a smaller consultancy firm for cross platform. Microsoft buy these guys ;) Perfect complement to Xamarin!

@weitzhandler
Copy link
Contributor

weitzhandler commented Apr 28, 2020

@JensNordenbro
Yes, read this article. They have tools to generate templates from cmd or vsix.

@koenvd
Copy link

koenvd commented May 1, 2020

Hi

I created a very basic UWP app with a WebView2 control on the MainPage.

When setting the UriSource it apperars that for some URL's (like http://www.google.com) the webview doesn't become visible. However for other URL's it does work (eg http://www.bing.com).

Based on the requests it's doing it looks like the webview is fully active but just does not become visible. I already tried to set the UriSource at different moments in the Page lifetime but couldn't make it work.

I also tried same URL's with https://blog.stevensanderson.com/2019/11/18/2019-11-18-webwindow-a-cross-platform-webview-for-dotnet-core/ and I see the same behavior there so it might be an issue with Edge Beta as well I guess.

Not sure if known issue? Also let me know if and where I would need to create specific issue for this. Thanks!

@codendone
Copy link
Contributor

@koenvd Do you also see this problem if trying to navigate to those URL's directly in the Edge Beta browser? I don't repro this issue. How recent is your install of Edge Beta?

Since you can also repro the issue outside of WinUI, please log your issue in the Edge WebView Feedback project here: https://github.com/MicrosoftEdge/WebViewFeedback/issues/

@koenvd
Copy link

koenvd commented May 6, 2020

@codendone I didn't see the issue when navigating to those URL's directly in (latest) Edge Beta. However I uninstalled the beta and installed the stable version (81.0.416.68 (Official build) (64-bit)) and now everything started working! It looks great!!

Thanks for the support!

@phraemer
Copy link

phraemer commented May 7, 2020

Any word on when we'll see the next Alpha of WebView2?

@adambarlow
Copy link
Contributor Author

@phraemer, the latest improvements will be coming in the Preview 1 release of WinUI 3 that is going to release for BUILD 2020.

@phraemer
Copy link

phraemer commented May 7, 2020

Great news @adambarlow , thanks!

@dstaley
Copy link

dstaley commented May 11, 2020

I also want to echo the experience that @koenvd had. I had the latest Edge Canary and Dev installed, and my WebView2 components wouldn't render correctly. Uninstalling both Canary and Dev and installing Stable fixed the issue.

@ranjeshj ranjeshj unpinned this issue May 19, 2020
@Felix-Dev
Copy link
Contributor

Now that WinUI 3.0 Preview 1 has been released I think we can close this issue in favor of #2472.

@ranjeshj ranjeshj removed the hot label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion General discussion
Projects
None yet
Development

No branches or pull requests