locked
BuildShadowTask Failed unexpectedly - Accessor Problem (Upconvert VS 2005 to 2008) - URGENT

    Question

  • This problem could not come at a worse time. So we need this fixed fast. Any help is welcomed.

    Recently our whole solution has been converted from Visual Studio 2005 to 2008. Also all of the projects have been converted to target 3.5.

    At first everything was compiling fine. However, ever since the Unit Tests have been cleaned or rebuilt the individual test projects cannot build if they are accessor dependent. They fail with the following exception:



    Error    560    The "BuildShadowTask" task failed unexpectedly.
    System.IO.FileLoadException: API restriction: The assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
       at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
       at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
       at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.LoadData()
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.Init()
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.Shadower..ctor()
       at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.Execute()
       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)    TargetingTests

    Monday, March 03, 2008 6:32 PM

All replies

  • I am having the same exact error, did you ever get any resolution to this?

     

    Error 286 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) DLLName.Test

     

    Wednesday, March 19, 2008 2:12 PM
  •  

    As with most of my post lateley no I have not gotten a good answer. This is getting disturbing. The only thing I have done latley is pull out the UnitTests projects that are causing the issue.

     

    I have installed a VS 2008 hot fix, and I have not tried it the UnitTest project to see if it is fix. I will try and have a go at it again and let you know. I will aslo find the link for the hotfix.

    Wednesday, March 19, 2008 3:01 PM
  • Hotfix

     

    http://weblogs.asp.net/scottgu/archive/2008/02/08/vs-2008-web-development-hot-fix-roll-up-available.aspx

     

    BTW this fixed some serious issues with VS 2008. At first it ran fine without it then one day VS2008 basically crashed my system. First searches (CTRL+F) and (CTRL+SHFT+F) stopped working. Wierd thing is "Find all references" and "Go to definition" still worked. The I accidently opened Outlook and my system became completley unstable. I had to reboot the system. After that VS2008 was a mess until I got this service pack. I still have some issues with searching every once in a while. Even if I am looking at the text I want to search for sometimes it will not find it.

    Wednesday, March 19, 2008 3:02 PM
  • No luck it is still broken. I am highly suspicious that it is becacuse VS 2005 and VS 2008 are really not compatable side by side. Even though they are said to be.
    Wednesday, March 19, 2008 6:37 PM
  •  

    Hi, did you get a fix for this. I have started experiencing the same issue?
    Wednesday, April 16, 2008 3:35 PM
  • Sorry to say this, but we still have not found a fix. We have just not included the test project for the time being.

    Wednesday, April 16, 2008 5:07 PM
  • I ran into this problem today (the null reference version).  It seemed to go away when I removed and then re-added an accessor in Test Reference.  I think the accessor was marked with a warning.

    Post back if this solves the problem.
    Monday, April 21, 2008 10:57 PM
  •  

    Hi KHorne,

     

    I had no errors on my accessor file, although removing it and re-adding it certainly seems to have gotten rid of the error for now! I'll keep an eye on it and see if it's gone for good.

     

    Thanks for your help,

     

    Al.

    Tuesday, April 22, 2008 8:30 AM
  • This does get rid of the Build ShadowTask error. However, now that the accessor file is deleted, your solution will not compile if you were dependent on any accessors. Currently I am using the accesor so I have a broken project. So I guess the question is how do I generate a new accesor file that will not have BuildShadow task conflictions.
    Tuesday, April 22, 2008 6:08 PM
  •  zNEMz wrote:
    This does get rid of the Build ShadowTask error. However, now that the accessor file is deleted, your solution will not compile if you were dependent on any accessors. Currently I am using the accesor so I have a broken project. So I guess the question is how do I generate a new accesor file that will not have BuildShadow task conflictions.

     

    Hi zNEMz,

    You can generate a new accessor by right clicking on the class name that needs the accessor.  This will bring up the context menu that contains the option to create the private acessor.  Select that option and youshould be good to go.

     

    Cheers,

    KHorne

    Tuesday, April 22, 2008 6:37 PM
  • Right I did that already and you beat me to the post Smile . Anyways I now get the same BuildShadowTask error again. !!!
    Tuesday, April 22, 2008 6:40 PM
  • slightly different exception


    Error    536    The "BuildShadowTask" task failed unexpectedly.
    System.IO.FileLoadException: API restriction: The assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
       at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
       at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
       at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.LoadData()
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.Init()
       at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.Shadower..ctor()
       at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.Execute()
       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)    TargetingTests

    Tuesday, April 22, 2008 6:41 PM
  • I also recreated a the test project from scratch, and I still get the same error without adding any files. So this is more than likley a problem at the solution level.

    NEM
    Tuesday, April 22, 2008 6:48 PM
  • BTW this is a MSB4018 error which has happened before when upgrading development environments.

    I have looked at and tried both of these post with no luck.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=491745&SiteID=1

    https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2413771&SiteID=1
    Tuesday, April 22, 2008 7:19 PM
  • 7>------ Rebuild All started: Project: TargetingTests, Configuration: Debug Any CPU ------
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018: The "BuildShadowTask" task failed unexpectedly.
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018: System.IO.FileLoadException: API restriction: The assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.LoadData()
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.WebBinder.Init()
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at Microsoft.VisualStudio.TestTools.UnitTesting.Publicize.Shadower..ctor()
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.Execute()
    7>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
    7>Done building project "TargetingTests.csproj" -- FAILED.
    Tuesday, April 22, 2008 7:21 PM
  •  AlanKell wrote:

     

    Hi KHorne,

     

    I had no errors on my accessor file, although removing it and re-adding it certainly seems to have gotten rid of the error for now! I'll keep an eye on it and see if it's gone for good.

     

    Thanks for your help,

     

    Al.

     

    Just a quick follow up on this incase anybody is interested. I came to check my project file into our source control and noticed that a line of code had changed in it after me removing and re-adding the accessor file. The line said...

    <Shadow Include="Test References\MyLibrary.accessor" />

    ...when I was getting the error and it now says...

    <None Include="Test References\ProNetLibrary.accessor" />

    ...and I no longer get the error. I went back in our source control history and as it happens, the error started appearing when the line was introduced into the project file.

     

    This may be relevant and as such some use to somebody struggling with this issue with the key word 'shadow' being there .... or maybe not?

     

    Cheers,

    Al.

    Thursday, April 24, 2008 5:04 PM

  • This is still the equivilant to removing the accessor all together. So if your depending on using an accessor this will not help you. I need the acessor to compile, the compiler seems to have issues with different versions of System.Web.
    Thursday, April 24, 2008 6:20 PM
  • The only code in our solution that uses System.Web.dll is log4net. Log4net is throughout our entire solutions so maybe its loaded System.Web.dll is conflicting with the unit test one.

    This was not an issue in VS 2005.
    Thursday, April 24, 2008 6:31 PM
  • zNEMz,

     

    Did you fix this problem?

    You should try to run the Publicize.exe command line tool and try to manually generate your accessor, it will give you more detail on the problem.

    We have ran into some problems with this tool because of some generic classes in our project and I am currently considering to use our own accessors.

     

     

    Monday, May 19, 2008 8:31 PM
  • Sorry it has been a while, but work has been nuts. Anyways, I have not been able to try it latley and I can no longer try it on my old PC (died hardware not windows). Anyways, I will try it on my new laptop when I get the chance. I will get back with you.

     

    Thursday, May 29, 2008 11:07 PM
  •  

    Hope to find the answer here:

    http://geekswithblogs.net/hinshelm/archive/2008/07/03/tfs-error-msb4018-the-quotbuildshadowtaskquot-task-failed-unexpectedly.aspx

     

    Ahh, yes!  It worked.  I had to delete the .accessor file and it worked.

     

    Thanks, Martin.

    • Proposed as answer by El BrunoMVP Wednesday, November 03, 2010 5:16 PM
    Monday, August 04, 2008 12:42 PM
  •  

     

    Hope to find the answer here:

    http://geekswithblogs.net/hinshelm/archive/2008/07/03/tfs-error-msb4018-the-quotbuildshadowtaskquot-task-failed-unexpectedly.aspx

     

    Ahh, yes!  It worked.  I had to delete the .accessor file and it worked.

     

    Thanks, Martin.

    Monday, August 04, 2008 12:48 PM
  •  

    I will get back to you on this. Sorry that I have not replied in a while. My old machine died and on my new macine I am currently only running VS 2008. I will try to put back in the Unit Tests and see if I get the same problems.

     

    Thanks for all the possible solutions!

    Monday, August 04, 2008 1:56 PM
  •  

    Thats a problem you could have if somewhere in your solution, you created a singleton and end up removing it. Visual studio keeps a reference to that instance and for some reason, is not as accurate in reflecting changes.

    Hope that helps,

    Stephen

    Wednesday, August 27, 2008 12:16 PM
  • Just remove the accessor file under test reference
    Wednesday, December 03, 2008 12:12 PM
  • This actually does not work for me as I need a new accessor created to replace classes that were created in the original accessor. So now the .sln breaks from missing classes that the original accessor provided. So this is a partial fix.

    So I removed the acessor, only to create a new one to receive the same exact Shadow error. Ugh frustrating!!!!!!!!!!!!!!
    Friday, December 19, 2008 5:41 PM
  •  
    Nick McCready,Now this issue is resolved it? And you how to resolve it.
    thanks !
    Friday, February 06, 2009 9:12 AM
  •  

    What's going on here?  I don't know exactly, but I've got some bits and a workaround.

    The BuildShadowTask is a component used by the Microsoft.TeamTest.targets used to build the private accessor DLL (e.g. myproject_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.

    A bit more on Chris Tacke's scenario.  He's taken one of my patterns and created a TestClassBase that does some common initialization, cleanup and provides some test specific helper functions.  This has been put into a CF unit test assembly that has no real unit tests in it.  Since it has no real unit tests in it, it has no private accessors in it either.

    This was essentially the item that triggers the downfall, albeit, he wasn't doing anything really wrong.

    It appears that when MSBuild, BuildShadowsTask and Publicize do their work, they're pulling in some copy/version of Microsoft.VisualStudio.SmartDevices.UnitTestFramework from somewhere else besides where the rest of the MSBuild process is going to get it from.  And, somehow it is being kept in the same AppDomain as the rest of the MSBuild process.  (So, I doubt that it is publicize.exe that's the problem).  Or vice versa, MSBuild is pulling one in and then BuildShadowsTask is attempting too as well.

    Friday, February 06, 2009 9:26 AM
  •  If you are going to use private accessors in any framework unit test assembly in your solution, use it in all framework unit test assemblies.  Even if you have to refer to something you don't need to make a private accessor.  Even if you create a "shill target" assembly, you need to have in it in all of them.
    Also, we had previously attempted to overcome the inability of Team Build to find the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll by registering it in the GAC.  As always, when you mess with fire you get burnt.  At this point, I  add the following in build scripts (update the path as appropriate to find Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

    <ItemGroup>
    <AdditionalReferencePath Include="c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\" />
    </ItemGroup>


    清凉世界
    Friday, February 06, 2009 9:29 AM
  • I get the following error message when I tried to Build my Unit Test on MSVS Team Suite 2010 Beta. Can anybody please help me on this error?

    Error     1          The "BuildShadowTask" task failed unexpectedly.

    System.Web.HttpException (0x80004005): The assembly 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.20506\Temporary ASP.NET Files\tempvdir\4acd1638\3466384a\App_WebReferences.dll' is already loaded in another appdomain. Setting <deployment retail="true" /> in machine.config can help solve this issue. ---> System.Web.HttpException (0x80004005): The assembly 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.20506\Temporary ASP.NET Files\tempvdir\4acd1638\3466384a\App_WebReferences.dll' is already loaded in another appdomain. Setting <deployment retail="true" /> in machine.config can help solve this issue.

       at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)

       at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)

       at System.Web.Compilation.BuildManager.CompileWebRefDirectory()

       at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()

       at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()

       at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()

       at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir)

       at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir)

       at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback)

       at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)

       at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback)

       at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)

       at System.Web.Compilation.ClientBuildManager.PrecompileApplication()

       at Microsoft.VisualStudio.TestTools.BuildShadowReferences.BuildShadowTask.GetWebsiteAppCodeDll(String webSitePath, String assemblyName)

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

       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)     TestProject1

    Thanks,

    Muhammad Sabri

    Thursday, October 08, 2009 3:43 PM
  • Yes。
    The problem is missing of Accessor file .

    To be code or not . It is a problem.
    Wednesday, October 21, 2009 10:12 AM
  • I just had the same problem after having done a global search and replace using command line utilities.  Thanks to this thread I managed a work around.  I deleted the Test Reference as KHorne suggested.  But that still had didn't allow me to run the test, as Nick McCready noted.  To solve that, I cut and repasted the DataSource attribute.  That seems to cause visual studio to recreate the shadowed test reference.  It then compiles and the tests run.  I think all this was necessary because I had to manually change some names in the arguments to the DataSource attribute to match the work done on the command line.  
    Tuesday, February 16, 2010 11:05 PM
  • HI Guys,
    I have had nightmares with BuildShadowTask failures in my project.
    I have not experienced any problems with IDE builds. But when, I was running an MS Build on the same source code, I was getting a BuildShadowTask failure in the projects which were using private accessors.

    I am fairly sure, all of you, who are experiencing BuildShadowTask failures in projects that are using Private Accessors, will find that their projects are having reference to "System.Web".

    If thats the case, then, as suggested by some individuals in this thread, to remove the private accessors and again regenerate them, will definitely not solve the problem. And there is no hotfix available from Microsoft (as suggested above) which will fix the issue.

    I have worked with an ADC member from Microsoft UK, and they have finally confirmed that there is a bug related to Private Accessors and projects referencing System.Web. Bad news is, microsoft USA dev team are only going to fix this issue in Visual Studio 2010.

    Cheers
    sayan
    Monday, February 22, 2010 5:22 PM
  • I got BuildShadowTask failures in the regular build. I verified all the change sets which were included in this build. I found one of teh change set was having unit tests changes in a test project.
    I just opened that test project file and searched for

    <Shadow Include="Test References\

    And replaced with <None Include="Test References\
    and checked in the code.

    I got passed my next build and no BuildShadowTask  failure.

    cheers.

    Anurag


    Anurag Verma
    Friday, March 05, 2010 1:38 AM
  • I have Just removed the accessor file under test reference and it worked for me :)
    Friday, April 30, 2010 9:05 AM
  • Hi

    I recently had a variety of ShadowBuild problems:

    The "BuildShadowTask" task failed unexpectedly. error BC30456: <member> is not a member of <class>.

    It seems to be a chicken and egg issue.  In that the test needed the class and the class needed the test to build.

    I deleted accessor and excluded web site tests.  Got everything compiling.  Recreated the tests (compiled), then included the excluded tests (compiled).  ... then I was back (after multiple hours and this post helped).

    But, the next day, "BuildShadowTask" error was back.  I ended up with <solution>.vsmdi and <solution>1.vsmdi.  I used notepad and edited the solution file and set it back to <solution>.vsmdi and deleted <solution>1.vsmdi (thanks Alexei!).

    Phil


    PHuhn
    • Proposed as answer by P.Huhn Friday, July 01, 2011 8:16 PM
    Saturday, June 19, 2010 3:48 PM
  • The problem still occurs in VS2010:

    Microsoft Visual Studio 2010
    Version 10.0.30319.1 RTMRel

     

    Iv'de got an Test project working fine with VS2008. Now I use VS2010 and I'm not able to compile this projekt any longer:

     

    Error    3    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.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)    TestJamUtils

    Other (old) Test projects work. Only this one doesn't.

     

    Any further ideas? (Yes, I tried deleting the .accessor files)

     

    Greetings

     

    Harald

    Thursday, November 25, 2010 12:13 PM
  • Sorry,

    got it: I need to completely remove the Test References and rebuild them, not only the files. See: http://geekswithblogs.net/hinshelm/archive/2008/07/03/tfs-error-msb4018-the-quotbuildshadowtaskquot-task-failed-unexpectedly.aspx

    Thursday, November 25, 2010 12:16 PM
  • Sorry I never answered to David Wang, anyways the code base that had the issue is no longer being used, and we are no longer using VS 2008 (2010) . However the problem was never resolved.
    Wednesday, December 29, 2010 5:42 PM
  • Hi,

    I came across this error in Visual Studio 2010 because I forgot to add the "Test References" folder with the "accessor" to subversion when commiting the project to subversion.

    I made my test project using Visual Studio and added some unit tests. Everything was fine until I commited the project to subversion and checked it out again, then I got the "BuildShadowTask" error.

    Copying the "Test References" folder and the "DAL.accessor" from the previous project which I still had on my PC to the latest project check out solved the problem.

    Friday, May 06, 2011 9:29 AM
  • Hi,

    I am a beginner in this technology. I tried to resolve this issue by deleting temp. internet files in <win Path>\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files folder and it worked for me.

    • Proposed as answer by TechLearner Tuesday, August 02, 2011 2:29 PM
    • Unproposed as answer by TechLearner Tuesday, August 02, 2011 3:46 PM
    Tuesday, August 02, 2011 2:29 PM
  • it works(null reference version too),thank u. 

    Friday, July 20, 2012 2:16 AM