[File] could not be retrieved because a writable file by the same name exists locally

Jan 5, 2010 at 1:21 AM

Hello,

I am getting this error when trying to run a buddy build with a specific shelveset. Other shelvesets don't give me any error. Does anyone know what the problem is?

-Devin

 

 

Task "ExecMulti"

Current command: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe unshelve "BehaviorFix;REDMOND\derrickt" /recursive /noprompt.

Common\CoreFramework\Config\Environments:Unshelving edit: BETANET.configUnshelving edit: BETAPROD.configUnshelving edit: FUNC.configUnshelving edit: INT.configUnshelving edit: LOCALHOST.configUnshelving edit: PERF.configUnshelving edit: PROD.configUnshelving edit: QFE.configUnshelving edit: WLTSKYMVM01.config

$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/WLTSKYMVM01.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/LOCALHOST.config: opened for edit in derricktlaptop;derrickt opened for edit in STHARPER8;stharper opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/QFE.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/PROD.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/PERF.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/INT.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/BETAPROD.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/FUNC.config: opened for edit in derricktlaptop;derrickt opened for edit in STHARPER8;stharper opened for edit in DERRICKTDEV2_PLAY;derrickt$/SkyMarket/Server/Main/Test/Common/CoreFramework/Config/Environments/BETANET.config: opened for edit in derricktlaptop;derrickt opened for edit in DERRICKTDEV2_PLAY;derricktH:\Build\1081\Sources\Common\CoreFramework\Config\Environments\BETANET.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\BETAPROD.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\FUNC.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\INT.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\LOCALHOST.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\PERF.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\PROD.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\QFE.config could not be retrieved because a writable file by the same name exists locally.H:\Build\1081\Sources\Common\CoreFramework\Config\Environments\WLTSKYMVM01.config could not be retrieved because a writable file by the same name exists locally.

Result: True. Failed running command [Exit Code: 1]: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe unshelve "BehaviorFix;REDMOND\derrickt" /recursive /noprompt.

Done executing task "ExecMulti".

Coordinator
Jan 5, 2010 at 2:58 AM

Devin,

It looks like your TFS build script includes a step where the config files are stripped from their read-only attribute to make them writable after getting the files from TFS. Typically this is done to set the version number in those files (or it could be some other information that the build script needs to update).

Since your shelveset includes some of the same files that have been made writable, the unshelve will fail since it cannot overwrite writable files in a workspace.

How to resolve this?

There are several options, but the one I would recommend is the following:

  • Modify the Team Build script (or talk to your team's build lab engineers) so that the step where the task is called to strip the read-only attribute and modify the config files is done in the "BeforeCompile" target. For example, if you encapsulate that logic into a target called "UpdateConfigFilesVersionNumber", you can do something like this to move the change to before compilation:

<Target Name="UpdateConfigFilesVersionNumber">

<!-- Make config files writable and update version number in them to match the Team Build version number. -->

</Target>

<Target Name="BeforeCompile" DependsOnTargets="UpdateConfigFilesVersionNumber">

<!-- You might have other stuff in here if BeforeCompile is already overridden and used in your build script. -->

</Target>

 This is recommended since it postpones the config file changes until right before building. This way the changes will be made to your shelved version of the file rather than the original version.

Please let me know if that does not help.

Thanks,

-Mohammad

Jan 5, 2010 at 10:28 AM

Worked like a charm. Thanks!!!