Nathan A
Nathan A

Reputation: 11319

Visual Studio 2012 Fakes Missing Required Reference

I have started using Fakes with VS 2012 in the last few months, and have recently come across what I believe must be a bug in the Fakes framework. In short, the f.crpoj file that is generated by my Fakes file does not include a reference to one of my assemblies. When this happens, the *.fakes.dll file is not generated, with the following error:

The type 'MyType' is defined in an assembly that is not referenced. You must add a reference to assembly 'MyAssembly, Version=0.1.0.0, Culture=neutral, PublicKeyToken=**'. **ProjFolder\obj\Debug\Fakes\as\f.cs

I have created test solutions but haven't been able to reproduce this problem outside of my complicated solution. Something is keeping the Fakes generator from including all assemblies. My Fakes file has no custom Stub/Shim generation parameters. Any thoughts?

Upvotes: 3

Views: 1131

Answers (1)

Oleg Sych
Oleg Sych

Reputation: 6558

We have recently fixed a similar problem in Fakes for Visual Studio 2013. In the new version it will pass all references from the parent project to the generated f.csproj and you will be able to solve problems like this by referencing MyAssembly from the parent project. Please consider submitting this at http://connect.microsoft.com/visualstudio. That way we would be able to accept a larger project for investigation and keep it private.

Upvotes: 3

Related Questions