1
votes

We're using SlowCheetah to do app.config transforms for a project. However, when trying to move the build process to Visual Studio Online, I can no longer build the solution. The build fails because the .dll.config file cannot be found. I believe this is caused by SlowCheetah.

Here's what we're using: SlowCheetah 2.5.10.6. As the build template I'm using the TfvcTemplate.12.xaml process. My NuGet version is 2.8 and Package Restore is enabled for the solution.

I've come across a few similar issues but most solutions apply to VS2012 or older versions of SlowCheetah and NuGet.


Update June 17

After looking more carefully at the log file generated by MSBuild, I found that the transform succeeds, and when my project is built, I see this line in the log: Copying file from "obj\Release\Assembly.Worker.csproj-sc.App.config" to "C:\a\bin\Assembly.Worker.dll.config".

However, I also have an Azure cloud service project, which is built next. Here's where the build fails.

This is what I find in the log: C:\a\src\ProjectFolder\Assembly.Azure\Assembly.Azure.ccproj(101,5): error MSB3030: Could not copy the file "..\Assembly.Worker\bin\Release\Assembly.Worker.dll.config" because it was not found.

So apparently SlowCheetah creates a transformed config file and saves it as a .csproj-sc.app.config file, while the Azure project looks for a normal app.config file. Interestingly, building the Azure project locally works fine.

1
That's likely a bug in Azure targets then. If it doesn't work with SlowCheetah it will fail with BCL NuGet pkg as well since they use the same technique to update app.config.Sayed Ibrahim Hashimi

1 Answers

0
votes

In the end I fixed the problem by changing the SlowCheetah.Transforms.targets file in the Properties folder.

At line 157 I inserted the following code to copy the transformed file to the path that Azure expects:

<Copy Condition=" '$(_Sc_HasAppConfigTransform)'=='true' "
  SourceFiles="$(__SC_IntermediateAppConfig)"
  DestinationFiles="$(MSBuildProjectDirectory)\bin\Release\$(MSBuildProjectName).dll.config"
  SkipUnchangedFiles="true" ContinueOnError="false" />