cannot modify .csproj files using build auto with

2019-06-24 04:56发布

问题:

I created a workflow activity named EditCsproj which is a C# class that I added to my build template. I put it right after the Initialize Workspace step.

This workflow has to get all .csproj files in the directory path that I provide as a parameter and it has to modify them.

But for each files, I have the following error :

Access to the path 'file.csproj' is denied.

I run Visual Studio with Administrator rights and I already changed the msbuild multi-proc property to false.

Does anybody have an idea?

回答1:

That's a classic gotcha. You need to remove the read-only flag from the files before editing them.