jessehouwing / azure-pipelines-tfvc-tasks

Azure Pipelines tasks for Team Foundation Version Control
https://marketplace.visualstudio.com/items?itemName=jessehouwing.jessehouwing-vsts-tfvc-tasks
MIT License
28 stars 17 forks source link

Not able to update a DLL. #93

Closed NehaaSinghh closed 4 years ago

NehaaSinghh commented 4 years ago

Hi, I am trying to update a DLL in TFS on successful completion of a build pipeline. But DLLs do not get identified as edited when we replace old DLL with the new one. So I am following below steps to accomplish this task-

  1. Delete old dll i.e. add as deleted in the pending changes.
  2. Check-in the change.
  3. Copy new DLL to the mapped folder.
  4. Add file to pending changes.
  5. Check-in the changes.

The issue is it either adds the new file to TFS or deletes existing one. I want both the operations to be done after every build. PFA for the log files. This time it already has the DLL on TFS so it is deletes it perfectly but while adding the new one it throws "[warning]The item ** already exists.**"- Logs.zip

Thanks!

jessehouwing commented 4 years ago

Any specific reason you commit the delete first? Why not simply overwrite the file?

Right now you're basically doing a "restore" and I'm not sure how the powershell code interacts with the "do you want to restore history for this item?" prompt that I thing you'd get when using tf.exe.

I haven't tested this scenario before. I may be able to work around this after the holidays.

For now, I'd remove the "2. Check-in change" step. It serves no real purpose anyway.

jessehouwing commented 4 years ago

Check: https://github.com/jessehouwing/azure-pipelines-tfvc-tasks/issues/90

It explains how to detect the pending change on the dll file. These extensions are excluded by default.

It would be even better to add a .tfignore file to your specific folder to allow .dll files.

e.g.:

in $/Decos Menuet/MenuetSettingsRenaming/Binaries/.tfignore

!*.dll

PS it looks like you're on the 1.x version of the task. I highly recommend updating to 2.x.