Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 631
aknuds1 Avatar asked Aug 31 '12 14:08

aknuds1


2 Answers

This bug is present in VS2013 as well. Link to MSDN bug.

Work Around: Delete file .messages from FakeAssemblies folder.

like image 74
Carbine Avatar answered Oct 13 '22 21:10

Carbine


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

like image 22
aknuds1 Avatar answered Oct 13 '22 22:10

aknuds1