dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.08k stars 1.17k forks source link

Net Core 6: Microsoft Fakes and WPF Issue #9955

Closed vsfeedback closed 1 month ago

vsfeedback commented 1 month ago

This issue has been moved from a ticket on Developer Community.


Hello,

I'm in the progress of migrating our WPF from .Net 4.7.2 to .Net Core 6 I run into issues with our test projects that reference WPF and use Microsoft Fakes Please see my demo repo here: https://github.com/RoyRosenberg/msFakesWPF

Basically, the problem can be described like the following:

When trying to compile, I got the 20 errors related to Fakes generation, one of them is:

Error CS7069 Reference to type 'DependencyObject' claims it is defined in 'WindowsBase', but it could not be found

image.png

Please help me find out the problem Thanks in advance, Roy


Original Comments

Feedback Bot on 8/23/2022, 11:05 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Dolly Wang [MSFT] on 8/23/2022, 11:53 PM:

Thanks for your feedback! Unfortunately, we cannot reproduce the issue using your repo in the latest stable version of Visual Studio installed from https://visualstudio.microsoft.com/downloads.
Could you update your Visual Studio to the latest version, and also delete the existing bin and obj folder in your repo, and then try again?

Roy Rosenberg on 8/24/2022, 00:29 AM:

Hello,
Thanks for the quick response

I just upgraded VS to 17.3.2
I performed delete to all bin/obj and FakesAssemblies folders and performed a clean build, but the errors continue to appear…weird.
I also cloned again the repo to a new folder but got the same errors

buildErrors.txt

My installed VS Info:

Microsoft Visual Studio Enterprise 2022
Version 17.3.2
VisualStudio.17.Release/17.3.2+32819.101
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Enterprise

ASP.NET and Web Tools   17.3.376.3011
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.3.376.3011
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.3.376.3011
Azure Functions and Web Jobs Tools

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

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

Microsoft Azure Tools for Visual Studio   2.9
Support for Azure Cloud Services projects

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

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

Razor (ASP.NET Core)   17.0.0.2232702+e1d654e792aa2fe6646a6935bcca80ff0aff4387
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.0.62207.04100
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.10701.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.3.0-3.22412.4+c97184bafab9a34d61e85f1c1ef34f25283ce9ba
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.1.0-beta.22363.4+1b94f89d4d1f41f20f9be73c76f4b229d4e49078
Microsoft Visual F# Tools

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

Roy Rosenberg on 8/24/2022, 01:05 AM:

Dolly Wang,

FYI - I attached the warning logs I think they also help us understand the root cause

warnings.txt

Got conflicts on WindowsBase:

Found conflicts between different versions of "WindowsBase" that could not be resolved

Dolly Wang [MSFT] on 8/23/2022, 11:55 PM:

Build.PNG
NoError.PNG

Dolly Wang [MSFT] on 8/24/2022, 01:37 AM:

(private comment, text removed)

Roy Rosenberg on 8/24/2022, 09:27 AM:

Dolly Wang,

Thanks again for your help

Unfortunately, I cannot overcome it.
I also tried from another machine with VS 2022 installed and got the same problem - I don’t know how it works on your side…
I have VS 2019 and VS 2022 installed, both are up-to-date
Here are the installed SDKs/Runtimes:

5.0.411 [C:\Program Files\dotnet\sdk]
6.0.400 [C:\Program Files\dotnet\sdk]

Microsoft.AspNetCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.28 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

I made sure all Nuget package versions are the latest
What else can I do?
Thanks,

Feedback Bot on 8/24/2022, 06:06 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Roy Rosenberg on 8/28/2022, 09:23 PM:

Dolly Wang hi,

Hope you are doing well

I tried again on a 3rd computer, but got the same errors/warnings
Is there any news on your end?

Thanks,
Roy

Roy Rosenberg on 9/1/2022, 11:41 PM:

Dolly Wang hi,
I just wanted to inform you that the issue still exists. I cannot continue with the migration to .net core 6.0
Please let me know if you have any progress regarding this
Thansk for your help
Roy

Roy Rosenberg on 9/20/2022, 10:12 AM:

Hi,
Still got no answer, and the problem persists
Can someone please reply with an update?
This ticket is more than 1 month and I managed to reproduce it on 5 different PCs
Thanks,
Roy

Roy Rosenberg on 11/5/2022, 11:58 PM:

Hello,
It’s been 3 months and the problem is not resolved
We can not continue with the migration to .Net Core because of this
Visual Studio 2022 is up to date
The project NuGet references are all up to date
still have an issue

[C:\Users\roy.rosenberg\Downloads\msFakesWPF-master\FakesWPFIssue.Test\obj\Debug\net6.0-windows\Fakes\fwpfi\f.csproj]    FakesWPFIssue.Test  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets   2302    

Please help me overcome this
Thanks in advanced,
Roy

Feedback Bot on 11/30/2022, 10:55 PM:

I detected that this issue hasn’t received a lot of activity, votes, or comments in the past 90 days. Based on this, the issues severity and affected area, it’s my experience that this issue is unlikely to get fixed. To improve the situation, consider following best practices for quality problem reports, and giving us more details on how this issue is impacting you.

Feedback Bot on 2/7/2023, 04:13 AM:

Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.


Original Solutions

Pankaj Chaurasia [MSFT] solved on 7/5/2024, 01:24 AM, undefined votes:

We moved this issue to a relevant GitHub project. Please comment and track it at this URL: https://github.com/dotnet/wpf/issues/9359

miloush commented 1 month ago

Should we close this one as duplicate of #9359?

himgoyalmicro commented 1 month ago

Hello, We are tracking this issue here: #9359. Therefore, closing this issue as duplicate.