Remoting from Team Foundation Services Build

Remoting from Team Foundation Services Build

Old forum URL: forums.lhotka.net/forums/t/3165.aspx


Brian O posted on Tuesday, July 10, 2007

I am back with another tricky one. I have a Project which runs Unit Tests for a Class Library project that is a CSLA 2.0 Business Object. This Unit Test project remotes to the application server just fine when I execute things in it by hand. But when my TFS build kicks off, the remoting fails. I get an error which says can not load CSLA assembly or one of its dependencies. The top of the stack reads

"System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)"

I am wondering if there is a security difference that maybe I am not handling, because the TFS Build runs under a special account?

Also, the TFS build puts all the binaries from the build into a folder and I suppose uses them from that folder, even though my CSLA assembly is in the GAC.

Any ideas, or anybody having success running Unit Tests Remotely under Team Foundation Server?

Thanks,

Brian (brian.f.oneil@gmail.com)

 

 

Brian O replied on Sunday, July 15, 2007

Found a fix to this problem. I placed some code in the class initialize of my unit test to check for the presence of the CSLA assembly in the CurrentDirectory. If it is not there, I copy it from a known location. Although not elegant, it allows the TFS build to remote the class during the unit test.

Like I posted before, the class being in the GAC should have allowed it to be used without a local copy. Guess this is just something particular to MSBuild.

Thanks for listening,

Brian

 

 

 

Copyright (c) Marimer LLC