-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MSBuild does not resolve WindowsBase correctly #8289
Comments
@RobThree I think it would be better to file that as a separate issue because it likely has a different root cause and has to be fixed and tested separately. |
@KalleOlaviNiemitalo I figured out it had to do with MySQL.Data 8.0.32 (so, yes, this is unrelated, sorry, my bad). |
Has this issue been resolved? Which version of Visual Studio can I build without encountering these warnings? Thanks. |
@hyke123 It has not been resolved as of the latest VS version (17.5.3). |
Maybe dotnet/sdk would be a better fit for this. There are some issues that sound related, for instance |
To circumvent this error, you may try to look at project.assets.json to help identify if some dependency is bringing in old Windows base version and then update this dependency accordingly. HTH |
I actually fixed this with
|
@dedale Thanks for the suggestion, but I do not use that file, and my project is WinForms and not WPF. This issue still happens as of today. Hopefully something will be done for .NET 8? |
My project is WinForms too so I enabled both 🤷♂️ . Otherwise you'll see in VS in framework dependencies of your project that WindowsBase is only taken from NetCore.App (in version 4). My finding is that when you also enable UseWPF, NetCore.WindowsApp dependencies also include WindowsBase is version of your tfm i.e. 6 or 7). |
@dedale Unfortunately just adding that to my csproj breaks the project: |
I have the very same issue with the WindowBase Assembly resolution but with a different kind of project (Maui Blazor Hybrid App) and running on .NET 8. Also adding
|
I also face this error in one of my projects. I found that when referencing an assembly that depends on WindowsBase version 6, the conflict happens. I can reproduce this in a very simple project, using both .NET 6 SDK and .NET 8 SDK. I have no desire to enable UseWPF in this project, as this project has no UI layer. Interestingly enough, when changing the Reference into a PackageReference, the warning is gone. Even though Visual Studio references the same full path of the dll. In this particular situation i am not able to use a PackageReference to the file i need, i need to use an assembly reference. Why does an assembly reference cause WindowsBase 4.0.0.0 to be included?
Resulting in error
|
Still has this issue in .net 8.0.402 sdk. Any progress should we know? |
@unseensenpai @sefinek In obj/project.assets.json, what is bringing in each dependency? |
@sefinek well sorry, it seems |
This was helpful, but in my case I was able to get rid of the mass of build warnings by flipping |
@dedale Yeah, I checked that file earlier... These errors are preventing me from publishing my app to the MS Store ):
Warning
Error (with Windows Application Packaging Project)
|
Updgrade the project |
Dropping back to v1.0.2739.15 removed this warning for me also. Thanks |
The latest version of Microsoft.Web.WebView2 |
Yep, I'm wondering why this hasn't been fixed yet. With the latest version of I've updated my #8289 (comment) to highlight the versions that encounter issues with the |
I'm getting the same issue here on a Library that uses WebView2 and |
@sir-wilhelm - Although there have been other reasons given, in this thread, for this conflict. Can you confirm WebView2 v1.0.2792.45 does not produce this warning/error for you? |
@Paul-Williams It should be easy for you to try |
Describe the bug
I am working with third-party components (DevExpress) and their new release based on .NET 6 appears to have exposed a potential bug in MSBuild's assembly resolution logic. There appears to be a versioning conflict between two WindowsBase DLLs in the WindowsDesktop and NETCore SDKs. For further details, please see this public support ticket. In particular, this reply.
The issue applies to both .NET 6 and .NET 7 WindowsDesktop projects.
To Reproduce
Here is a sample project you can build to reproduce. Just build it and look in the Visual Studio build output to see the below lines.
Exceptions (if any)
Further technical details
dotnet --info
:Visual Studio 2022 Version 17.4.3 (Windows)
The text was updated successfully, but these errors were encountered: