Search code examples
visual-studio-2010visual-studio-2012molesmicrosoft-fakes

Error "The type or namespace xxxx does not exist" when compiling Moles in Visual Studio 2012


I am attempting to compile an existing project (targets .NET4) developed in Visual Studio 2010 and now testing migration to VS2012.

When I compile my existing project with moles, I get the following error a lot.

The type or namespace name 'Claim' does not exist in the namespace 'System.Security.Claims' (are you missing an assembly reference?) [C:\ProjectPath\Project.Tests.Unit\obj\Debug\Moles\m\m.g.csproj] C:\ProjectPath\Project.Tests.Unit\m.g.cs

There is a huge list of various types that show this message.

Any thoughts?


Solution

  • We excluded some namespaces and types from the mole/stub generation based on this article:

    Troubleshooting in Visual Studio 11 / .NET 4.5

    and it's compiling now (a few test still fails but it's compiling).