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

windowsappsdk and webview2 pre-reease #1921

Closed
nzstevem opened this issue Nov 12, 2021 · 6 comments
Closed

windowsappsdk and webview2 pre-reease #1921

nzstevem opened this issue Nov 12, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@nzstevem
Copy link

Hi,

Please excuse my question if the answer here is obvious. I'm still getting to grips with the environment.

I have a win32/c#/winui/windowsappsdk app with a webview2 in the ui developed in VS 2022 using the templates provided that with the global switch enabled runs fine against the most recent Canary release of Edge.

I wanted to explore a couple of the api's added recently to Webview (setting up unique environment) and used Nuget to add the Microsoft.Web.WebView2 (1.0.0.1056-prerelease) to the project. The install ran without error.

However, in trying to rebuild the project the conflict between the version of Webview in the windowsappsdk and the pre-release nuget package is flagged - the reference is ambiguous.

1>C:\Users\mathe\source\repos\TestWV2\TestWV2\TestWV2\MainWindow.xaml.cs(31,82,31,94): error CS0433: The type 'CoreWebView2' exists in both 'Microsoft.Web.WebView2.Core, Version=1.0.1056.0, Culture=neutral, PublicKeyToken=2a8ab48044d2601e' and 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b'

And intellisense isn't aware of the new method signatures.

What do I have to do to tell Visual Studio and the build process to ignore the version of Webview at Winbdows.UI or conversely only look at the recent version in Micosoft.Web? Is there a document that will help somewhere?

Thanks in anticipation.

Steve

@champnic
Copy link
Member

Hey @nzstevem - Currently, the WindowsAppSDK ships with its own copy of WebView2 files, and doesn't currently support updating the WebView2 package separately. I'm fairly certain this is what you are running into. We have work planned to improve this experience, likely by making the WebView2 nuget a dependency of WindowsAppSDK, instead of bundling directly. Thanks!

@nzstevem
Copy link
Author

HI, that's exactly what is happening. Surely this should be treated as a bug then because you won't be able to make a release of webview without hitching a ride on the windowsappsdk release. Steve

@dahovey
Copy link

dahovey commented Nov 29, 2021

@champnic Why was this closed? This problem still exists and shouldn't be closed. Please remove question tag.

@champnic
Copy link
Member

Linking @dahovey's workaround from the other issue here: microsoft/microsoft-ui-xaml#5689 (comment)

This is definitely a bug, but it's a bug in the WindowsAppSDK package. Please use microsoft/microsoft-ui-xaml#5689 to track for now, and I'm following up with that team to see if there's a different item they're using to track this. Thanks!

@MikeG96
Copy link

MikeG96 commented Oct 4, 2023

@champnic Hello!

The workaround by @dahovey not works, any update of this?

@champnic
Copy link
Member

champnic commented Oct 4, 2023

Hey @MikeG96 - No update on our end here, though we continue to push on the XAML/WinUI team for this fix. The microsoft/microsoft-ui-xaml#5689 issue is the right one for tracking updates to this, and I saw you posted there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants