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

[Problem/Bug]: Found conflicts between different versions of "WindowsBase" that could not be resolved #4959

Open
mikemeinz opened this issue Nov 29, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mikemeinz
Copy link

mikemeinz commented Nov 29, 2024

What happened?

I upgraded a .NET Framework 4.8.1 VB .NET app that uses WebView2 to use .NET 9.0. Now, I get the following warning message when I build the project. My project does not use WPF. My project only uses WinForms.

5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277: Found conflicts between different versions of "WindowsBase" that could not be resolved.
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277: There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:     "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:     References which depend on "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].
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:         C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref\net9.0\WindowsBase.dll
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:           Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref\net9.0\WindowsBase.dll".
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:             C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\9.0.0\ref/net9.0/WindowsBase.dll
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:     References which depend on or have been unified to "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:         C:\Users\MikeMeinz\.nuget\packages\microsoft.web.webview2\1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:           Project file item includes which caused reference "C:\Users\MikeMeinz\.nuget\packages\microsoft.web.webview2\1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll".
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:             C:\Users\MikeMeinz\.nuget\packages\microsoft.web.webview2\1.0.2903.40\buildTransitive\..\\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll

That is the only error or warning message from the build process.

Visual Studio Help / About / Installed Products
Microsoft Visual Studio Community 2022
Version 17.12.1
VisualStudio.17.Release/17.12.1+35514.174
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools 17.12.178.10385
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.12.178.10385
Azure App Service Tools v3.0.0

C# Tools 4.12.0-3.24558.5+21192bfc323cbdd5a1f6e5dadca56ef0558c8adf
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Code Converter 1.0
Code Converter Extension Details

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub Copilot 17.12.31.40377
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

IndentRainbowPackage Extension 1.0
IndentRainbowPackage Visual Studio Extension Detailed Info

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

MSBuild Editor 2.9.524+91c41270f3
Language service for MSBuild projects and targets

Node.js Tools 1.5.60927.1 Commit Hash:34ed3f8d94747ae6aeaeadb9ccb1dd51411eba1a
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.12.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Rainbow Braces 1.0.164
Colorizes matching brace pairs to make it easy to identify them and their scope. Works for curly brackets, parentheses, and square brackets.

Razor (ASP.NET Core) 17.12.3.2451803+13fe97052e82683ec4c9fc916531eba5c751037f
Provides languages services for ASP.NET Core Razor.

RunCommand Extension 1.0
RunCommand Visual Studio Extension Detailed Info

SQL Server Data Tools 17.12.78.0
Microsoft SQL Server Data Tools

TypeScript Tools 17.0.30918.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.12.0-3.24558.5+21192bfc323cbdd5a1f6e5dadca56ef0558c8adf
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.12.0-beta.24501.1+19610c0b654766eec49d044cb97ca6eaa2a63d16
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

131.0.2903.70

SDK Version

1.0.2903.40

Framework

Winforms

Operating System

Windows 11

OS Version

22631.4037

Repro steps

Rebuild and run program in Debug mode.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@mikemeinz mikemeinz added the bug Something isn't working label Nov 29, 2024
@mbodm
Copy link

mbodm commented Dec 7, 2024

Hi,

same here (or at least rather similar):

C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(2413,5): warning MSB3277:
  Es wurden Konflikte zwischen verschiedenen Versionen von "WindowsBase" gefunden, die nicht aufgelöst werden konnten.
  Konflikt zwischen WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 und WindowsBase, Vers  ion=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
      WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 wurde aufgrund der primären Eigensc  haft WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 vorgezogen.
      Verweise, die von "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" abhängig sind [  C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.11\ref\net8.0\WindowsBase.dll].
          C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.11\ref\net8.0\WindowsBase.dll
            Elementincludes einer Projektdatei, die den Verweis "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref  \8.0.11\ref\net8.0\WindowsBase.dll" verursacht haben.
              C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.11\ref/net8.0/WindowsBase.dll
      Verweise, die von „WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35“ [] abhängen ode  r damit vereint wurden.
          C:\Users\Marcel\.nuget\packages\microsoft.web.webview2\1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Micro  soft.Web.WebView2.Wpf.dll
            Elementincludes einer Projektdatei, die den Verweis "C:\Users\Marcel\.nuget\packages\microsoft.web.webview2\  1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll" verursacht haben.
              C:\Users\Marcel\.nuget\packages\microsoft.web.webview2\1.0.2903.40\buildTransitive\..\\lib_manual\net5.0-w  indows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll

Environment:

  • The .csproj TFM (target framework moniker) is set to "net8.0-windows"
  • Installed dotnet version is 9.0.100 (output of dotnet --version)
  • Used WebView2 package version is Latest (WebView2 1.0.2903.40)
  • Used Visual Studio 2022 version is 17.12.2
  • Used Windows Version is Windows 10 Pro 22H2 (Build 19045.5131)

Sorry for the non-english parts in the error message. I'm using a german Windows version.

I just thought i should post it. Maybe it helps the devs. Maybe it doesn't. But at least it also don't hurt. 😉

@zzmyers
Copy link

zzmyers commented Dec 12, 2024

Same issue here.

Found conflicts between different versions of "WindowsBase" that could not be resolved. There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not. References which depend on "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 Project file item includes which caused reference "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 References which depend on or have been unified to "WindowsBase, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" []. C:\Users\Doctor\.nuget\packages\microsoft.web.webview2\1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll Project file item includes which caused reference "C:\Users\Doctor\.nuget\packages\microsoft.web.webview2\1.0.2903.40\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll". C:\Users\Doctor\.nuget\packages\microsoft.web.webview2\1.0.2903.40\buildTransitive\..\\lib_manual\net5.0-windows10.0.17763.0\Microsoft.Web.WebView2.Wpf.dll

@ATECoder
Copy link

Same here:

Found conflicts between different versions of "WindowsBase" that could not be resolved.
There was a conflict between "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" and "WindowsBase, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".
    "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was chosen because it was primary and "WindowsBase, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" was not.
    References which depend on "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
          Project file item includes which caused reference "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
    References which depend on or have been unified to "WindowsBase, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" [].
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\WindowsFormsIntegration.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\WindowsFormsIntegration.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\PresentationCore.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\PresentationCore.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\PresentationFramework.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\PresentationFramework.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\ReachFramework.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\ReachFramework.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\System.Printing.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\System.Printing.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll
        C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\UIAutomationProvider.dll
          Project file item includes which caused reference "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref\net9.0\UIAutomationProvider.dll".
            C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\9.0.0\ref/net9.0/WindowsFormsIntegration.dll

Project info;

    <TargetFrameworks>net472;net48;net9.0-windows</TargetFrameworks>
    <NoWarn>NU1701;RAZORSDK1006</NoWarn>
    <OutputType>WinExe</OutputType>
    <UseWindowsForms>true</UseWindowsForms>

Visual Studio Info:

Microsoft Visual Studio Community 2022
Version 17.12.3
VisualStudio.17.Release/17.12.3+35527.113
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools 17.12.178.10385
ASP.NET and Web Tools

Atomineer Pro Documentation 1.0
Source-code documentation-comment creation and maintenance, and other documentation-related tools.

Azure App Service Tools v3.0.0 17.12.178.10385
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 17.12.178.10385
Azure Functions and Web Jobs Tools

C# Tools 4.12.0-3.24572.7+dfa7fc6bdea31a858a402168384192b633c811fa
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Code Converter 1.0
Code Converter Extension Details

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.24269.5
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Extensibility Message Bus 1.4.42 (main@840f8b3)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub Copilot 17.12.38.29086
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

Markdown Editor v2 2.0.174
A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.12.5 (918dbb1)
Support for debugging Mono processes with Visual Studio.

Multiline Search and Replace 3.5
Adds multiline search and replace functionality to Visual Studio.

NuGet Package Manager 6.12.2
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Python - Profiling support 17.0.24269.5
Profiling support for Python projects.

Python with Pylance 17.0.24269.5
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.12.3.2457601+b5256abf658352440e61aa1372bbc0798e9ceb7d
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.12.83.3
Microsoft SQL Server Data Tools

SVG Viewer 1.0.16
Makes it much easier to work with SVG files by showing a live preview in the bottom-right corner of the code window

TypeScript Tools 17.0.30918.2001
TypeScript Tools for Microsoft Visual Studio

Uno Platform Extension 1.0
Uno Platform Extension to create cross-platform apps using iOS, Android, mac Catalyst, Skia and WebAssembly.

Visual Basic Tools 4.12.0-3.24572.7+dfa7fc6bdea31a858a402168384192b633c811fa
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.12.0-beta.24501.1+19610c0b654766eec49d044cb97ca6eaa2a63d16
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info

WiX Toolset Visual Studio Extension 1.0.0.22
WiX Toolset Visual Studio Extension version 1.0.0.22
Copyright (c) .NET Foundation and contributors. All rights reserved.

Xamarin 17.12.0.153 (d17-12@1d0906d)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.12.3.17 (remotes/origin/main@0912a005b9)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: d9a6e87
Java.Interop: xamarin/java.interop/d17-5@149d70fe
SQLite: xamarin/sqlite@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d

@praxmarer
Copy link

same issue here

@Aspage
Copy link

Aspage commented Dec 23, 2024

Same issue here! It works, but the message annoys me!

@imessagewall
Copy link

same issue:
“WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” and “WindowsBase, Version=5.0.0.0, Culture=neut
ral, PublicKeyToken=31bf3856ad364e35”
build success,but show this warning!

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

7 participants