Net Core 6: Microsoft Fakes and WPF Issue

Roy Rosenberg 1 Reputation point
2022-08-23T15:47:50.847+00:00

Hello,

I hope I posted in the correct forum...

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:

  • Class Library project with <UseWPF>true</UseWPF>
  • The project contains ControlDemo class that inherits from UserControl class
  • MSTest project with reference to the class library project
  • I added fakes assembly to the class lib. project

When trying to compile, I got the following error

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

The error is duplicated 20 times, so I got 20 errors in the error list window:
234185-image.png

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

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,667 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
326 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Rosenberg 1 Reputation point
    2022-11-18T22:35:55.253+00:00

    Hi LP,
    The issue is fixed in the latest version of VS (17.4 I guess).

    0 comments No comments