Share via


Visual Studio 2017 to 2019 Unit Test "BuildShadowTask" Error

Question

Thursday, April 11, 2019 6:27 PM

Hello,

After moving to VS 2019 my unit tests won't compile anymore with the following error:

The "BuildShadowTask" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\TeamTest\Microsoft.VisualStudio.TestTools.BuildShadowsTask.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\TeamTest\Microsoft.VisualStudio.TestTools.BuildShadowsTask.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

It appears it is still referencing v15.0 instead of v16.0 in the path, but I can't find where to update it.

All replies (2)

Friday, April 12, 2019 10:28 AM âś…Answered | 1 vote

Hi BobFakes,

Welcome to MSDN forum.

Please have a try the following steps:

1, Edit the unit test .csproj file and change the item references from<Shadow Include="Test References\namespace.accessor" /> to <None Include="Test References\namespace.accessor"> 

2,delete all the .accessor files from the unit test project's Test References folder.

Please click here for more information.

Best Regards,

Dylan

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]


Tuesday, April 23, 2019 8:28 AM

Hi BobFakes,

Sorry for bothering you. Any update for this issue?

1. For the wrong path(15.0 instead of 16.0 for vs2019) as you mentioned above, please check this link.

It's one issue which has been reported to Developer Community. Please update your vs2019 to latest version to check if the issue goes.

2. And the error message "BuildShadowTask" is something which realted to accessor. So if the issue persists after you update to latest vs version, I suggest you can follow Dylan's suggestion to help solve it. 

Best Regards

Lance

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].