But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

More thoughts on addressing TF900546 ‘Unable to load one or more of the requested types’ on TFS2012

A while ago I posted about seeing the TF900546 error when running unit tests in a previously working TFS 2012 build. The full error being:

TF900546: An unexpected error occurred while running the RunTests activity: 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'.

Well late last week this problem came back with avengeance on a number of builds run on the same build controller/agent(s). Irritatingly I first noticed it after a major refactor of a codebase, so I had plenty of potential root causes as assemblies had been renamed and it was possible they might not be found. However, after a bit of testing there were no obvious candidates as all tests worked fine locally on my development PC, and a new very simple test application showed the same issues. It was defiantly an issue on the build system.

I can still find no good way to debug this error, Stackoverflow mention Fuslogvw and WinDbg, as well as various copy local settings and the like. Again all seems too much as this build was working in the past, just seemed to stop. I tried a couple but got no real information, and the error logs were empty.

In the end I just tried what I did before (as I could think of no better tactic to pin down the true issue). I went into the build controller config, removed the reference to the custom assemblies, saved this settings (causing a controller restart), then put it back (another restart of the controller)

image

After this my test started working again, with no other changes

Interesting a restart of VM running the build controller did not fix the problem. However this does somewhat chime with comments in the StackOverFlow thread that causing the AppPool in MVC apps to rebuild completely, ignoring any cached assemblies, seems to fix the issue.

Comments (3) -

  • Justin Pinnix

    11/13/2012 2:25:14 PM |

    Hi Richard,

    First of all, please make sure your custom assemblies were recompiled with 2012.  If they were compiled with 2010, they could be trying to load old versions.  If that doesn't work, make sure no builds run on this controller have 2010 strong name references.  If a build with 2010 references runs before your build, it can tank future builds.  You said that it works after restarting the controller, which makes me think it's persisted state from an old build.

    See Jason's blog for more details:  blogs.msdn.com/.../...ng-versioned-namespaces.aspx

    Thanks,
    -JP
    Development Lead - TFS Build

  • richard

    11/13/2012 2:29:08 PM |

    Thanks for the pointers Justin, just to confirm it only started working again after clearing the setting for custom assemblies then reapplying it.

    I can confirm I am using 2012 API custom assemblies.

    The strange thing is these build were working, then stopped. I made not application code, build work flow etc. changes. Just restarted the controller without loading custom assemblies then switched them back on.

  • cara membuat website

    12/8/2012 6:35:21 AM |

    Hy Ricards,
    Just desire to say your article is as astonishing. The clarity in your publish is simply spectacular and i could think you're a professional on this subject. Well together with your permission let me to snatch your RSS feed to stay updated with coming near near post. Thanks 1,000,000 and please carry on the gratifying work.

Comments are closed