0

I'm trying to use SlowCheetah to transform a Web.config and a App.config. Now when I check these files out for edit with TFS all works well. If however I do not check out for edit I get:

Could not write Destination file: Access to the path 'C:\Projects.....\App.config' is denied.

Could not write Destination file: Access to the path 'C:\Projects.....\Web.config' is denied

Is there a way to check these files out for edit automatically?

Paul Sinnema
  • 2,534
  • 2
  • 20
  • 33

1 Answers1

0

A trick is to add the MSBuildTasks nuget package and change the .csproj as follows:

    <Import Project="..\packages\MSBuildTasks.1.5.0.235\tools\MSBuild.Community.Tasks.Targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\tools\MSBuild.Community.Tasks.Targets')" />

    <Target Name="BeforeBuild">
      <Attrib Files="App.config" ReadOnly="false" />
      <TransformXml Source="App.Base.config" Transform="App.$(Configuration).config" Destination="App.config" />
  </Target>
Paul Sinnema
  • 2,534
  • 2
  • 20
  • 33