The "BuildShadowTask" task failed


The "BuildShadowTask" task failed

When Running tests Team System you got this error –


Error 8 The "BuildShadowTask" task failed unexpectedly.

System.NullReferenceException: Object reference not set to an instance of an object.

   at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.Execute()

   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) APITestProject


I got help from this MSDN Post

The BuildShadowTask is a component used by the Microsoft.TeamTest.targets used to build the private accessor DLL,
that a unit test uses to get at private and protected members of a test target.

It in turn calls the Publicize.exe executable to do the actual work.

To test “Internal” , “Private” or “Friend” methods you need to add Accessor to your TestProject.



Than Team System will add Accessor file with the name of the project you are testing.



Remove this file from the Test References folder and your tests will start working.

Good Luck

Add comment
facebook linkedin twitter email

Leave a Reply


  1. shair29/03/2009 ב 17:33

    Hello Ronen,
    As you can read Martin talks about different error.
    The problem in his blog talks about missing assembly file – System.IO.FileLoadException.
    And my post talks about Null you get when running test from Team System IDE.
    And you right the problem is the same and the solution.

    Before writing this kind of comment please read more carefully.

  2. Trearenny20/11/2011 ב 13:04

    Trearenny, – kamagra preise Achtung: Trotz des Umstandes, dass der folgende Artikel bei bestem Wissen und Gewissen entstanden ist, sind Fehler nicht auszuschliessen. – levitra bestellen