Skip to content

C# Samples #2

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

Open
yannduran opened this issue Aug 18, 2019 · 16 comments
Open

C# Samples #2

yannduran opened this issue Aug 18, 2019 · 16 comments
Labels

Comments

@yannduran
Copy link

Could you please provide samples in C#, not just C++? I can't make use of C++ project as I (and no doubt MANY others) develop solely in C#.

Thanks!

@david-risney
Copy link

Thanks, yes. We're looking into .NET support. We've got an issue open on our WebViewFeedback project. MicrosoftEdge/WebView2Feedback#23

@OranguTech
Copy link

OranguTech commented Dec 13, 2019

@yannduran - Since the reply wasn't quite clear:

webview2 doesn't support C# yet.
https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2#supported-platforms

Developer preview is available for Win32 C++ on Windows 10, Windows 8.1, Windows 8, and Windows 7. In the future, we plan to support WebView2 on .NET, and XAML.

@pagoe-msft
Copy link
Contributor

@yannduran @OranguTech

Yes, we do not currently support C# yet, but doing so is among our top priorities. After we release C# support, we plan to release a Sample Application in C#.

@yannduran
Copy link
Author

@pagoe-msft

Why is this issue closed? Until C# samples are released this issue has not been addressed. It should remain open until that happens.

@pagoe-msft pagoe-msft reopened this Dec 14, 2019
@dangershony
Copy link

Any update on a cross platform C# sample? (based on a console app not on wpf or winforms)

@pagoe-msft
Copy link
Contributor

As of now the WebView2 control is not cross-platform. We can look into building a console app sample. I'd love to get a sense of what you're building and what you'd like to use WebVIew2 for.

@yannduran
Copy link
Author

I would really like to see a WPF sample actually. I should have specified that originally.

@sondreb
Copy link

sondreb commented May 27, 2020

There is suppose to be .NET Core support, is that through WPF or is it possible to spawn a webview2 window from a .NET Core console app?

https://docs.microsoft.com/en-us/microsoft-edge/webview2/reference/dotnet/0-9-515-reference-webview2

image

@shawty
Copy link

shawty commented Jun 3, 2020

@sondreb I too tried this a few days ago and go no success, so I fell back to normal .NET winforms and everything worked fine, so it appears to me at least that core support is not yet finished.

@pagoe-msft
Copy link
Contributor

@yannduran - a WPF sample is now published in WebView2Samples
@sondreb / @shawty - .NET Core should work with WinForms. What issues are you running into? This is likely a bug on our end that we'd like to fix right away.

@sondreb
Copy link

sondreb commented Jun 3, 2020

@pagoe-msft I'm looking for a solution like "WebWindow", where I can cross-platform run a .NET Core app with logic, that hosts an HTTP endpoint that serves an web app UI. It shouldn't matter what the UI is, if it's JavaScript, Blazor, Angular, React, etc.

I'd like to avoid any dependency on Windows Forms. WebWindow is a good attempt, but that is just a proof-of-concept, would like for the WebView2 to support a scenario like the one I just described.

Then we (as an industry) can avoid distributing the Chromium and Node.JS runtime every time we build a desktop app with web technology. The Xbox Beta app recently migrated from Electron to React Native to reduce resource consumption (RAM).

@shawty
Copy link

shawty commented Jun 3, 2020

@pagoe-msft - Following this (https://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winforms) I noticed that it also said:

image

Since I prefer core projects at the moment (I'm currently writing a book on Core with Packt) I opted for using Core, but no matter what I tried I could not get the WebView2 control to appear in the toolbox is VS19.

I'm on the VS19 Preview track, I installed the Canary Build for Edge, and no dice.

As soon as I switched over and tried the same instructions with regular .NET winforms, no problem, it all worked as expected.

I was actually going to report it as a different issue, I just forgot :-)

@yannduran
Copy link
Author

yannduran commented Jun 4, 2020

@pagoe-msft

Thanks for the heads up. Though I would have liked to, I can't use WebView2 while it requires Canary build for Edge.

@alamathe1
Copy link

@pagoe-msft Wanted to check if Webview2 provides support for accessibility - that lets screen readers like JAWS and NVDA recognize the rendered HTML elements?

@HoldenPCaulfield
Copy link

I have to say that this sample application is profoundly complex. I know that is not what you want to hear, but I am stunned at the complexity of this technology.

@shawty
Copy link

shawty commented Jan 4, 2021

@HoldenPCaulfield to be fair it's really not. Seriously :-) that is actually a quite simple application, they just perhaps try to do to much in the one sample.

If you want complex, take a look at the custom browser I started to write using it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants