-
-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: An item with the same key has already been added while running Cake from commit hooks #1319
Comments
@vijays-git @vengi83644 PR submitted, artifacts available here, could you please test if it sorts your issue. Cake-bin-net45-v0.17.0-PullRequest1320.zip should contain what you need. |
@devlead I tried putting all the files from this zip to the tools/cake folder and got the below issues Cake-bin-net45-v0.17.0-PullRequest1321.zip Cake-bin-net45-v0.17.0-PullRequest1320.zip Error: Could not load file or assembly 'tools\Cake\Roslyn.Compilers.CSharp.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) |
@vijays-git @vengi83644 think I know why, delete all files except below (the rest will be downloaded at first run)
|
I did the below steps |
As per gitter discussion, you can verify running correct version once unzipped using file properties Also check to other Cake in path. i.e. enter full path to Cake.exe to make sure you're running correct version. |
https://gitter.im/cake-build/cake?at=58139604806316005dce3c08 Now I have commented the below codes and this worked. #if ($LASTEXITCODE -ne 0) { else{
|
I am getting same error now for NuGet package restore task. Restore-NuGet-PackagesExecuting task: Restore-NuGet-Packages slnFile Test.sln An error occured when executing task 'Restore-NuGet-Packages'. Error: Item has already been added. Key in dictionary: 'home' Key being added: 'HOME' |
As this is merged it'll be in the next release, already avail on our MyGet feed. This Stackoverflow answer describes how to use prerelease version of Cake: |
Could you run Cake with diagnostic debugging so we get a full stack trace? |
Yes. Here is the Stack Preparing to run build script... -Message Restoring tools from NuGet... Running build script... Module directory does not exist. Analyzing build script... Analyzing /build.cake... Processing build script... Creating script session... Adding reference to mscorlib.dll... Adding reference to System.Core.dll... Importing namespace Cake.Common.Tools.DotCover.Report... Importing namespace Cake.Common.Tools.DupFinder... Importing namespace Cake.Common.Tools.GitReleaseManager... Importing namespace Cake.Common.Tools.GitReleaseManager.Publish... Importing namespace Cake.Common.Tools.NUnit... Importing namespace Cake.Common.Tools.ReportGenerator... Importing namespace Cake.Common.Tools.ReportUnit... Importing namespace Cake.Common.Tools.Roundhouse... Importing namespace Cake.Common.Tools.SignTool... Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport... Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport... Importing namespace Cake.Common.Tools.TextTransform... Importing namespace Cake.Common.Tools.WiX... Importing namespace Cake.Common.Tools.WiX.Heat... Importing namespace Cake.Common.Tools.XBuild... Importing namespace Cake.Common.Tools.XUnit... Importing namespace Cake.Common.Xml... Compiling build script... CleanExecuting task: Clean The provided pattern did not match any directories. The provided pattern did not match any directories. Deleting file .FxCopAnalysis.xml Deleting file .StyleCopAnalysis.xml Deleting file .StyleCopAnalysis.xml Finished executing task: Clean Restore-NuGet-PackagesExecuting task: Restore-NuGet-Packages slnFile E:/test/Server/Base Projects/test/Test.sln Executing: "E:/test/Server/Base Projects/test/tools/NuGet.exe" restore "E:/test/Server/Base Projects/test/Test.sln" -NonInteractive at Cake.Core.ActionTask.Execute(ICakeContext context) |
@vengi83644 Thanks, that helps a lot, I'll submit PR to address this once I'm at a computer. |
Below is the process we are doing
From Commit Hook file
exec powershell -Command "& '$REPOSITORYPATH/build.ps1' -Script '$REPOSITORYPATH/build.cake'"
From Build.ps1
Invoke-Expression "&
"$CAKE_EXE
""$Script
" -verbosity="$Verbosity
""From Build.cake - a simple task to clean directories
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
Also, we have discussed this in the below gitter.
https://gitter.im/cake-build/cake?at=5811a7d75a1cfa016e4f992f
Reproduced issue mentioned in the below link.
https://gitter.im/cake-build/cake?at=5811aa598ed1c0ff5c32e357
The text was updated successfully, but these errors were encountered: