开发者

Files marked as readonly during build

开发者 https://www.devze.com 2023-01-15 06:58 出处:网络
It seems that when TFS does a build, when it creates the build directory and pulls the files down from source, it is marking all the source files as read only. This is causing a problem with a BizTalk

It seems that when TFS does a build, when it creates the build directory and pulls the files down from source, it is marking all the source files as read only. This is causing a problem with a BizTalk solution that we have, it looks like at build time biztalk generates/edits a cs c开发者_如何学Golass for mapping files, and this is the same type of file that gets and unauthorized access exception during the build if it is marked as readonly. But for the life of me, and cannot figure out how to change this behavior of the TFS. Any ideas?


The files are marked readonly, because it is doing a get latest version from TFS. If BizTalk is generating a file during compilation, you can either not include this file in Source Control, or you can remove the readonly flag of that file.

You can remove the flag in TFS 2010 by editing the Build Process Template and add an InvokeProcess activity to execute the attrib -r command.

For more information how to add the InvokeProcess to the build process template see http://www.ewaldhofman.nl/post/2010/04/27/Customize-Team-Build-2010-e28093-Part-2-Add-arguments-and-variables.aspx


This is normal behaviour. But if you have some automatically generated (i.e. minification/grunt ...) processes that require writable files, update your project file and make each file writable in a prebuild process.

<Target Name="BeforeBuild">
<Exec Command=“attrib -R $(SolutionRoot)\myFile.ext“ />
</Target>

I know its late, but hope this will help someone come here.

Reference from: https://benoit808.wordpress.com/2007/10/30/changing-a-files-attribute-from-a-msbuild-script/


Do NOT check-in the .cs files into Source Control for a biztalk project. Go to those files in Source Control and delete them.


In my case, I checked my local files and they were with READ-ONLY attribute, so I removed the attribute locally, checked-in the files again and it all works :

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号