slow-cheetah icon indicating copy to clipboard operation
slow-cheetah copied to clipboard

Multiple app.config related errors

Open deastr opened this issue 7 years ago • 12 comments

I had successfully implemented SlowCheetah for my app.config and appsettings.json files. For some reason I can't build the project anymore since I'm getting multiple errors related to app.config tasks. Here are the errors:

Project1:

MSB4094 "obj\Debug\net452\win10-x64\Project1.csproj-sc.App.config;obj\Debug\net452\win10-x64\Project1.csproj-sc.App.config" is an invalid value for the "AppConfigFile" parameter of the "GenerateBindingRedirects" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2100

Project2:

MSB4094 "obj\Debug\net452\win10-x64\Project2.config;obj\Debug\net452\win10-x64\Project2.csproj-sc.App.config" is an invalid value for the "AppConfigFile" parameter of the "GenerateBindingRedirects" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2100

MSB3249 Application Configuration file "obj\Debug\net452\win10-x64\Project2.config;obj\Debug\net452\win10-x64\Project2.csproj-sc.App.config" is invalid. Could not find a part of the path 'D:\Project2\obj\Debug\net452\win10-x64\Project2.csproj-sc.App.config;obj\Debug\net452\win10-x64\Identity.Services.Api.csproj-sc.App.config'. D:\Identity.Services.Api\obj\Debug\net452\win10-x64\Identity.Services.Api.csproj-sc.App.config;obj\Debug\net452\win10-x64\Identity.Services.Api.csproj-sc.App.config 1

Cleaning bin and obj folders before build doesn't help. I have no custom code for app.config in csproj files.

Any idea of what's wrong here?

deastr avatar Sep 29 '17 11:09 deastr

I've got the same error for one project (the only .Net Core project) of my Visual Studio solution. Any ideas on how to fix this?

Zarepheth avatar Nov 27 '17 15:11 Zarepheth

I've seen this turning up as well once I added a transformation for the debug configuration.

timbussmann avatar Dec 07 '17 09:12 timbussmann

I can confirm the problem, too. However, my project can be built successfully despite having the same error showing up. It happens every time when I build the project after cleaning the solution. I can no longer add new controllers (I am developing asp.net core in full framework) by scaffolding as if the project has some build errors. But if I clean the project only and build, everything goes normal and there is no error. When I try removing the SlowCheetah nuget package, the whole nuget list in Solution Explorer disappears entirely. Then the project cannot be built anymore as if there are no nuget packages installed. Luckily I can revert the project file from my TFS to temporarily hide the problem.

CometstarMH avatar Dec 08 '17 02:12 CometstarMH

Same problem here. Some help would be appreciated. This is a really annoying error.

SlowCheetah: 3.0.61 Visual Studio: 15.5.1 New csproj format (Sdk="Microsoft.NET.Sdk.Web")

andreasstolpmann avatar Dec 15 '17 10:12 andreasstolpmann

I'm also experiencing this error. Could it please be resolved!

patnolan avatar Dec 22 '17 03:12 patnolan

Hi,

Any update on this one? This is a major problem!

patnolan avatar Jan 21 '18 10:01 patnolan

I am also seeing this issue on two of the projects in my solution. Has anyone found a workaround or proper solution yet?

This just started happening to me out of the blue. I made a minor change to my production branch and pushed the changes. The solution builds locally, but not on VSO / MSBuild. I am not sure how to fix it. I suppose I may have to ditch slow cheetah?

fishslime avatar Jan 29 '18 20:01 fishslime

Hi @davilimap, @sayedihashimi and @jviau I've noticed you're with Microsoft and have worked with this code quite a bit. Is this an issue you may be able to look into or request someone else at Microsoft to investigate? We're a Microsoft Partner and are heavily dependent on slow-cheetah. Unfortunately this error is causing us and other people in the community alot of pain.

patnolan avatar Feb 16 '18 20:02 patnolan

This GitHib project seems to be dead :(

Unfortunately slow-cheetah is critical to the transform of our config files.

Does anyone know of any alternative solutions?

patricknolan avatar Mar 04 '18 12:03 patricknolan

I stumbled upon this article some days ago: https://johan.driessen.se/posts/Applying-MSBuild-Config-Transformations-to-any-config-file-without-using-any-Visual-Studio-extensions And this extension which looks better: https://marketplace.visualstudio.com/items?itemName=GolanAvraham.ConfigurationTransform

Actually there are many more tutorials on the web that are doing more or less the same thing: Add a new build target, reference Microsoft.Web.Publishing.Tasks.Dll, and use TransformXml tag. Unfortunately I don't have time to test it out. Anyone interested?

CometstarMH avatar Mar 08 '18 02:03 CometstarMH

GolanAvraham.ConfigurationTransform only supports XML files and doesn't support JSON files.

What if you disable automatically generating binding redirects?

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
  </PropertyGroup>
</Project>

icnocop avatar Mar 23 '18 04:03 icnocop

I've tried to reproduce this issue, but couldn't. I've seen people using .NET 4.5.1 and 4.6.2 and also people using .Net Core projects. Can someone provide me a clean repro so I can test this problem and make the fix?

davilimap avatar Apr 25 '18 17:04 davilimap