VS 2022 Shims, Stubs, Fakes fail to build

Robert Hull 6 Reputation points
2022-10-17T19:31:05.803+00:00

Just upgraded from VS 2012 Pro to VS 2022 Enterprise. Previously functioning Shims, Stubs and Accessors all fail to be created. ("not declared/defined")

Developer technologies | Visual Studio | Testing
Developer technologies | Visual Studio | Setup
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,346 Reputation points
    2022-10-17T21:19:50.297+00:00

    Did you go through the steps mentioned here? The Fakes framework and entire unit test subsystem was rewritten between 2012 and 2022. You need to make adjustments to your unit test projects (including upgrading them) as discussed in the docs before anything will work.

    Once you've done that, and if it still doesn't work, then please provide us the details of your project including the target framework, SDK or legacy project, test framework and version being used, and screenshots and/or example code to replicate the issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.