Reputation: 522
I'm building 2 solutions in a loop in TFS, and in both of them I have the same test DLL (targeted for 2.0 in the 1st solution, and for 3.5 in the second). Everything is fine on the first pass, but in the second, I get this:
API restriction: The assembly 'file:///D:\Builds\1\Project\Main\Binaries\FF3.5\Potato.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
How can I work around this, can I force the unloading of the DLL? Can I do something about the appdomain?
Thanks,
Upvotes: 1
Views: 1196
Reputation: 1317
You could try this solution, it just involves changing the expression that finds all the test dlls http://geekswithblogs.net/jakob/archive/2010/06/08/tfs-2010-build-dealing-with-the-api-restriction-error.aspx
Edit:
I investigated this further, it seems that the Test Assembly Filespec (2. Basic -> Automated Tests -> Test Assembly -> Test Assembly Filespec on the default template) is using the FindMatchingFiles activity. So you will have to write a pattern with that that will only match the files you think should be loaded. I couldn't find a guide to using the pattern but stuff like this works:
Where as stuff like this does not:
Upvotes: 1