TFS Dependency Replicator Gotcha

by Donn Felker 28. October 2008 03:09

Recently I was working with Dependency Replicator and I ran into an issue.  

 

Background

The file that is the "dependency" does not exist in the destination yet. Therefore the replicator fails. If it does not find the destination file in the dependent project location it will fail. In English: In $/TeamProject/Main/SharedBinaries/ there was no "utility.dll". However, this is EXACTLY where I wanted replicator to PUT the file. Since the file did not exist at the destination, I would receive this error in the event log:

-----------------------------------
Error in Event Viewer:

Dependency Repliccator error:
Event Type: Error
Event Source: DependencyReplicator
Event Category: None
Event ID: 0
Date:  10/23/2008
Time:  11:24:30 AM
User:  N/A
Computer: TFSSERVER
Description:
An error occured processing the dependency '$/TeamProject/Path/To/Dependency/dependency.dll' from build 'TeamProject_CI_20081023.5' in project 'TeamProject'. Processing subsequent rules will continue:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\DependencyReplicator\TeamProject\Path\To\Dependency\Dependency.dll'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
   at DependencyReplicator.BuildStoreWatcher.ExecuteDependencyReplicationRule(Rule rule, Workspace workspace)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

---------------------

 

Steps to recreate:

  1. Create two team projects
    1.   -  One being the one which will propogate the dependency (ex: shared utility dll or something). This would output a file called "utility.dll" which would then
        be propogated to other locations.
    2. Other being the project which utilizes the dependency "MytestProject". DO NOT put the dependency (utility.dll) in this team project anywhere.
  2. Set Depdenency Replicator xml to have the utility.dll file placed somewhere in "MyTestProject".
  3. Kick off a build for the utililty project. This should kick off the dependency repliccator.
  4. Error (above) occurs.

 

Work Around

Place a copy of the "utility.dll" into the destination where the dependency should be. From that point forward you will not have a problem.

 

The Real Fix

The real fix is to fix the source code. Since I'm not a developer on the project I whipped up this code (which please note is only POC at this time).

 

string fullyQualifiedSource = Path.Combine(rule.Event.Data.DropLocation, rule.Source);
string fullyQualifiedDestination = workspace.GetLocalItemForServerItem(rule.Destination);
if(status.NumOperations != 0) 
{
workspace.PendEdit(rule.Destination); 
File.Copy(fullyQualifiedSource, fullyQualifiedDestination, true);
}
else
{
File.Copy(fullyQualifiedSource, fullyQualifiedDestination, true);
workspace.PendAdd(rule.Destination); 
}

I'm going to build this hopefully later this week and submit it to the project. :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | TFS

How Did C# Get Its Name?

by Donn Felker 28. October 2008 01:23

It's an interesting name to say the least. Why the "sharp" symbol? Sometimes newcomers get it incorrect at first (usually people BRAND NEW to programming) and call it "C POUND". It Almost sounds like a hip-hop thing as the "pound" word has different context in that arena.

The knocking of fists as a form of greeting, departure or respect. - Urban Dictionary

But, alas, this is NOT what it means in terms of programming.

 

Here's Where The Name Came From

In the October 3rd 2008 edition of the CIO article "The A-Z of Programming Languages: C#" Naomi Hamilton interviewed the men of men, the one and only, Anders Hejlsberg (lead architect of C# - and other languages Pre c#). In this article he described where the name came from. The C# language was originally called "Cool" but it was changed. Here's the scoop:

[CIO] Why was the language originally named Cool, and what promoted the change to C#?

[AH] The code name was Cool, which stood for 'C like Object Oriented Language'. We kind of liked that name: all of our files were called .cool and that was kind of cool! We looked seriously at keeping the name for the final product but it was just not feasible from a trademark perspective, as there were way too many cool things out there.

So the naming committee had to get to work and we sort of liked the notion of having an inherent reference to C in there, and a little word play on C++, as you can sort of view the sharp sign as four pluses, so it's C++++. And the musical aspect was interesting too. So C# it was, and I've actually been really happy with that name. It's served us well.

 

Make sense?

csharpOrigins

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | Misc

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  October 2008  >>
    MoTuWeThFrSaSu
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    View posts in large calendar