Trying to run corflags from TFS Build 2010

2.1k views Asked by At

I am using an InvokeProcess activity in TFS 2010 to try and run the corflags application on a built exe.

C:\Builds\4\testing\Sources\BuildAssets\corflags.exe C:\Builds\4\testing\Binaries\Executable.exe /32bit+

However I am getting the following message:

corflags : error CF001 : Could not open file for writing

I am running the TFS Build Agent on my local machine because I am currently in a testing phase, and when I run the exact same command from the command line, the corflags application completes without error.

Any ideas would be greatly appreciated.

2

There are 2 answers

5
Basic On BEST ANSWER

I'm not familiar with the specific situation but some general ideas:

Who is the build running as? Does that user have permissions to the output path?

Another consideration is: Has the build completed before it attempts to execute your command?

Try changing the command to be something really simple eg Type "OutputFile" - Does this hit the same issue? If so, it's a permission/timing issue. If not, it's the specific command - but at least we'll have narrowed the problem down.

0
Ewald Hofman On

I don't know the corflags either, but it is using a file in the workspace (a file that is downloaded from Version Control). There is a readonly flag on this file by default.

So if you need this file to be writable:
1) either checkout the file if you need this file in your version control and afterwards check it in again (tf checkout / tf checkin)
2) remove the file from version control if the file is created by the app
3) remove the readonly flag with the attrib command.