13

I have an issue when i want to publish a project i receive the error message

"obj\debug\project.exe.config;obj\Debug\project.exe.config"is an invalid value for the "ConfigFile" parameter of the "GenerateApplicationManifest" task.
Multiple items cannot be passed into a parameter of type
"Microsoft.Build.Framework.ITaskItem".
I have searched about the issue and i found i have to uncheck "Enable ClickOnce security settings" at Properties/Security but still have the same problem cannot publish my project.. ?

screenshot

Crick3t
  • 659
  • 1
  • 8
  • 19
Charlie
  • 135
  • 1
  • 6

4 Answers4

22

Probably the transformation file is wrong. It seems like it is trying to add multiple config files at the same time.

Have you tried to look at your transformation file? It could be helpful, if you could post the transformation file.

Also this article, seems like there is a solution here for a similar issue:

I ran into this same problem. What fixed it for me was changing the line in the transform from above

from

<AppConfigWithTargetPath Remove="app.config" />

to

<AppConfigWithTargetPath Remove="@(AppConfigWithTargetPath)"/>

The AppConfigWithTargetPath config parameter can be found in the .csproj file.

Community
  • 1
  • 1
Crick3t
  • 659
  • 1
  • 8
  • 19
  • My transformation config is default* nothing more i will try it ,but i think that is gonna work my friend,thank you – Charlie Nov 28 '18 at 13:34
  • Switched from 2015 to 2017 and this fixed builds for me. – WernerCD Feb 25 '19 at 18:11
  • this is in the project file you need to edit it, this detail should be added.. – Seabizkit Dec 11 '19 at 12:27
  • @Crick3t: What transformation file are you referring to? This issue was in my project (.csproj) file. Thanks, Seabizkit. – Suncat2000 Feb 03 '20 at 15:49
  • @Suncat2000: OP's original issue was with a task, which suggests there is an issue with the transformation or the build file that is using the AppConfigWithTargetPath parameter which is in the .csproj file. (Hence the solution above). The build file is the one that end's with .targets (if you have one) and the transformation file can be any file, like .config where you set up transformation rules, like xdt:Transform="SetAttributes" – Crick3t Feb 06 '20 at 09:50
  • 1
    @Crick3t, I must have read, and skipped over this answer about 5 times because I didn't realise where this parameter was. Perhaps you could edit your main answer to include that the AppConfigWithTargetPath parameter is in the csproj file. Or maybe we should all just read a little better. Thanks! – russelrillema Jun 05 '20 at 05:06
  • @russelrillema I have added, hopefully it will save time for others. Thanks for the suggestion. – Crick3t Jun 05 '20 at 08:04
20

Got the same error on my WPF project (Visual Studio 2013), no idea why. I solved it disabling the ClickOnce security settings.

  • Project Properties
  • Security tab
  • Untick "Enable ClickOnce security settings"

enter image description here

Vland
  • 3,891
  • 2
  • 27
  • 38
5

I had the same problem recently, removing the tag <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> inside .csproj solved the problem.

mtanksl
  • 497
  • 5
  • 8
-1

This error when away after re-entering my outdated source control account credentials ( VisualStudio 2017: File > Account Settings... ).

ObiJuan
  • 67
  • 4