aknuds1 aknuds1 - 1 month ago 14
C# Question

Can't build project with Fakes assembly

I've added a Fakes assembly to my Visual Studio 2012 unit test project, corresponding to my application project (the System Under Test), as described in Peter Provost's article. However, the project will no longer build, on account of an unresolved type reference in the generated Fakes code:

The type or namespace name 'FieldDefinition' does not exist in the namespace 'bc::ProductStudio' (are you missing an assembly reference?)
[C:\Users\arvek\Projects\Project\Project.Tests\obj\Debug\Fakes\bc\f.csproj]
C:\Users\arvek\Projects\Project\Project.Tests\f.cs


What's going wrong here? From what I know, this is supposed to just work, so it would seem to me there's a bug in the Fakes facilities.

Answer

The error is most likely due to bug in Fakes triggered by the faked assembly. I've submitted the issue to Microsoft.