MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: [NET 9] Dependency conflict

Open
#4,924 28 comments 8 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

This phenomenon occurred after we upgraded to .NET 9.0, and a warning is generated during compilation:

File: Microsoft.Common.CurrentVersion.targets


发现无法解析的“WindowsBase”的不同版本之间存在冲突。
“WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”与“WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”之间存在冲突。
    已选择“WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”,因为它是主版本而“WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”不是。
    依赖于“WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”[C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref\net9.0\WindowsBase.dll]的引用。
        C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref\net9.0\WindowsBase.dll
          导致引用“C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref\net9.0\WindowsBase.dll”的项目文件项 Include 特性。
            C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref/net9.0/WindowsBase.dll
    依赖于或已统一到“WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”[] 的引用。
        C:\Users\user1\.nuget\packages\microsoft.web.webview2\1.0.2895-prerelease\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll
          导致引用“C:\Users\user1\.nuget\packages\microsoft.web.webview2\1.0.2895-prerelease\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll”的项目文件项 Include 特性。
            C:\Users\user1\.nuget\packages\microsoft.web.webview2\1.0.2895-prerelease\buildTransitive\..\\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll

The project does not use WPF or WinForms; it controls windows through the Win32 API (Set Handle). Therefore, there is actually no dependency on WindowBase at all. Previously, everything was normal in the .NET 8.0 environment.

Although the project is still running normally, we would also like to find the cause and eliminate this warning.

Thanks

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)

Runtime Version

130.0.2849.80

SDK Version

1.0.2895-prerelease

Framework

Other

Operating System

Windows 11

OS Version

22631.4460

Repro steps

Upgrade to .NET 9.0

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.