0
votes

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?

1
Are these files (app.config/web.config) in the bin/release folder?Neil
How long is the path to the web.config (there is a limit of 256 characters on Windows).Neil

1 Answers

0
votes

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>