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

Getting "MSB3030 Could not copy the file ..winuiex\2.4.1\lib\net6.0-windows10.0.19041\WinUIEx\runtimes\win-x64\native\WebView2Loader.dll" because it was not found. #188

Closed
MagnusJohansson opened this issue Sep 25, 2024 · 11 comments

Comments

@MagnusJohansson
Copy link

After adding WinUIEx to an OOB WinUI3 app template project, I get:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error (active)	MSB3030	Could not copy the file "E:\packages\NuGet\cache\winuiex\2.4.1\lib\net6.0-windows10.0.19041\WinUIEx\runtimes\win-arm64\native\WebView2Loader.dll" because it was not found.	App1WithWinUIEx	C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets	5321		
image

Reproducible projects:

  1. Project straight from VS Template:
    https://github.com/MagnusJohansson/App1WithWinUIEx

Which gives me:

This version of the Windows App SDK requires Microsoft.Windows.SDK.NET.Ref 10.0.19041.38 or later.
    Please update to .NET SDK 6.0.134, 6.0.426, 8.0.109, 8.0.305 or 8.0.402 (or later).
    Or add a temporary Microsoft.Windows.SDK.NET.Ref reference which can be added with:
        <PropertyGroup>
            <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
        </PropertyGroup>
image
  1. Project after adding the WindowsSdkPackageVersion:
    https://github.com/MagnusJohansson/App1WithWinUIEx/tree/feature/amend-appsdk-requirements

All good.

  1. Adding the latest WinUIEx Nuget package:
    https://github.com/MagnusJohansson/App1WithWinUIEx/tree/add-winuiex

I now get the "WebView2Loader.dll" error as stated at the top.
image

Of course, if I clone this WinUIEx repo and build, everything works, because then I have those runtime dependencies:
image

But I don't have them in my NuGet cache:
image

Any ideas?

@Trix07
Copy link

Trix07 commented Sep 25, 2024

I have the same issue, not only with the WinUIEx NuGet package but also with some internal NuGet packages. I think it has something to do with the decoupling of WebView2 from WinUI in the new 1.6 release, but so far I haven't found any workaround other than downgrading to 1.5.

@dotMorten
Copy link
Owner

Which version are you referencing? There’s a bug in webview package that 1.6 of windows app Sdk relies on but I added a workaround for that in 2.4.1.

If you are already on 2.4.1 could you share a repro app?

@MagnusJohansson
Copy link
Author

@dotMorten sure, see the third link in my original post.

@dotMorten
Copy link
Owner

Aaah thanks. Does this also happen to you if you don’t use the separate packaging project?

@dotMorten
Copy link
Owner

Actually I know what’s going on. I know I added that workaround for this issue but don’t see it now. Something in a merge must have gone wrong. I’ll get a fix out in a few hours …

@dotMorten
Copy link
Owner

I restored the fix but it'll be a little while before I can get to test it. If you have a minute, you can try the nuget package that'll be generated once the action completes here in a few minutes: https://github.com/dotMorten/WinUIEx/actions/runs/11035641248

@MagnusJohansson
Copy link
Author

I downloaded the WinUIEx.2.4.2.nupkg file from the action artifacts and referenced it as a local Nuget feed.
Seems to compile now.

@dotMorten
Copy link
Owner

Thanks for confirming. Looks like this issue only affects projects with a separate packaging project, which is why I missed it. It's a non-issue with single-project packaged apps.

@dotMorten
Copy link
Owner

Fixed in v2.4.2

@dotMorten
Copy link
Owner

@MagnusJohansson and thanks for the donation too! I'm having an extra coffee today :)

@dotMorten
Copy link
Owner

dotMorten commented Sep 25, 2024

Also see this in community toolkit: CommunityToolkit/Tooling-Windows-Submodule#216
Confirmed Microsoft has an internal bug to address it.

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

No branches or pull requests

3 participants