Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Fakes - The extern alias was not specified in a /reference option

I have a silverlight solution and I'am trying to create a fakes assembly for System.Windows.Controls.Data.DataForm.Toolkit (to play with DataForm).

After I add the fakes assembly I get the following build error:

Error 6 The extern alias 'swd' was not specified in a /reference option [C:\Dev\Temp\SLTest1\Controls.Tests\obj\Debug\Fakes\swcddft\f.csproj] C:\Dev\Temp\SLTest1\Controls.Tests\f.cs 16 1 Controls.Tests

Looks like that .csproj is regenerated on each build, so I can't modify the project file. How can I specify the reference? Any ideas?

like image 733
TDenis Avatar asked Nov 12 '22 08:11

TDenis


1 Answers

"Since System is a large library, the Fakes framework doesn’t automatically generate you a fake for every System class." Try explicitly adding "System.Windows" to the .fakes file.

<Fakes xmlns="http://schemas.microsoft.com/fakes/2013/">  <Assembly Name="System"/>  
<ShimGeneration>    
    <Add FullName="System.Windows"/>  
</ShimGeneration>
</Fakes> 

http://www.colinsalmcorner.com/2012/06/microsoft-fakes-customizing-system.html

like image 67
JakJackal Avatar answered Nov 25 '22 04:11

JakJackal