Setting location for a custom dll  
Author Message
Jon Braganza





PostPosted: Team Foundation Server - Build Automation, Setting location for a custom dll Top

I've created a custom dll which contains all of my custom tasks which I've written for MSBuild. The only problem is that all of my builds need this task. I just copied this dll into the directory for each build, but when make changes to the dll I have to update it for every build. Is there a better place I can put this so that I don't have to do this whenever it is updated

Thanks.


Visual Studio Team System19  
 
 
Steve St.Jean





PostPosted: Team Foundation Server - Build Automation, Setting location for a custom dll Top

I've created an installer for my custom task dlls. They get installed onto my build machines in "C:\Program Files\[Company]\MSBuild". When I update the assemblies, I can just redeploy to my two build servers and be done with it. Because there is a "well-known" path to the assemblies, I can set a consistent parameter to point to their install folder.

- Steve



 
 
Jonny_B





PostPosted: Team Foundation Server - Build Automation, Setting location for a custom dll Top

Where can you set this parameter to where you can find the binary file I think that I will probably do the same thing, except have a copy task that copies it to a specified location

 
 
Steve St.Jean





PostPosted: Team Foundation Server - Build Automation, Setting location for a custom dll Top

Since it sounds like you have multiple builds that you want to utilize this custom task dll from, I'd suggest creating a separate project file that you can Import into each of your TFSBuild.proj files.  You can do something like this:

<Project DefaultTargets="" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask TaskName="MyCustomTasks.ATask"
             AssemblyFile="$(TeamBuildRefPath)\MyCompany.MyCustomTasks.dll" />
</Project>

The TeamBuildRefPath property resolves to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies, so if you copy your assembly here, you can access it using this property.

Just be aware that the order of evaluation may mess you up.  The target containing your copy task may fire after the UsingTask task does, so when it MSBuild attempts to resolve and load you custom task assembly, it will not have been copied into place yet.  You might better off installing your custom task assembly onto the build machine(s) and just update it as necessary. 

- Steve



 
 
Jonny_B





PostPosted: Team Foundation Server - Build Automation, Setting location for a custom dll Top

Thanks a lot Steve,

I think that I will create a team build project for this dll and then do a post-build copy task to copy it to a common location so that it will always have the newest version.