-
Notifications
You must be signed in to change notification settings - Fork 54
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
[NuGet] WebView2Loader.dll
is copied twice to output
#2898
Comments
Related/more information: #1418 (comment) |
@czdietrich does this bug still exist for you? or have you found a resolution for it. |
@victorhuangwq |
This needs to be addressed. With WindowsAppSDK's recent dependency on this package, any library that takes dependency on it gets BROKEN, because it now also gets content into a class library, which means the .pri resource files gets references to files that aren't part of that SDK and then fails to build. |
Just in case someone is looking for a temporary fix. <!-- Remove unnessecary second WebView2Loader.dll from runtimes folder -->
<!-- See also: https://github.com/MicrosoftEdge/WebView2Feedback/issues/2898 -->
<Target Name="RemoveDuplicatedWebView2LoaderDll" BeforeTargets="AssignTargetPaths">
<ItemGroup>
<Content Remove="@(Content)" Condition="%(Content.Link) == 'runtimes\win-x64\native\WebView2Loader.dll'" />
</ItemGroup>
</Target>
|
I believe this has been just fixed and here is an internal build I can provide. Can anyone please try with this SDK version and verify if the bug doesn't repro anymore? The zip file needs to be renamed to nuget file |
@oggy22 Just looking inside the package I see some issues. There's also some odd automatic referencing WPF and WinForms DLLs which makes no sense if you're not actually using those frameworks (you should instead switch on The fact that there's now a |
@dotMorten there are some custom paths in our package where I'd appreciate feedback on the package version I provided as I believe it may fix this problem. Thanks! |
@oggy22 but AFAIK anything you put in the runtimes folder will be copied to the app output, and you don't want native_uap files copied for non-uap apps I assume?
That's why it should be split up. There's one main package, which references the right native runtimes based on TFM, and there are packages that sit above that for instance adds WPF support etc. Trying to do this in one package is probably the reason for this franken-nuget and all the issues that it'll ultimately create. |
@oggy22 Can you share a little bit about what was done to address this and what version it'll be shipped in? |
Description
The
Microsoft.Web.WebView2
NuGet always creates a folder structure equal toruntimes\win-x64\native\WebView2Loader.dll
in the output directory.The reason for this is that there are copy instructions in the
Common.targets
file for managed projects.There should be no need for copying manually any DLLs for managed projects, since NuGet has its own conventions for copying native DLLs into the output directory, which also makes use of the current
RuntimeIdentifier
. see NuGet specIn .NET Core there should be no
runtimes
folder when publishing an application for a specific platform.So, my request is that the NuGet should not copy manually any DLLs if NuGet semantics would already do it on its own. Or if there is an issue to correctly detect whether manual copying is needed, there should be a switch (property) to disable it.
Version
SDK: .NET Core 6.0.402
Runtime: win-x64
OS: Windows
Repro Steps
Microsoft.Web.WebView2
NuGet asPackageReference
dotnet publish -r win-x64 --no-self-contained
)The DLL can now be found twice in the output folder:
runtimes\win-x64\native\WebView2Loader.dll
WebView2Loader.dll
The text was updated successfully, but these errors were encountered: