Closed bzamora closed 4 years ago
On what environment (OS, Cake Version) do you have this error?
Note that you don't need the loaddependencies=true
for including the addin.
Cake 0.35.0, Windows 10.0.11763 Build 17763
Moved the issue to the Cake.Issues.Reporting.Generic
repository as it is an issue with this addin.
@bzamora I'm still trying to reproduce this issue.
Which Cake runner are you using? What version of .NET? Do you have a public repo where this can be reproduced?
@pascalberger
Which Cake runner are you using?
I am using standard Cake runner (not Cake.Tool or Cake.CoreCLR), is that what you mean?
What version of .NET?
Net 472
I will run with diagnostics and see if can provide additional insights.
Do you have a public repo where this can be reproduced?
I am pretty booked this week, but will try to get something together soon.
Below is part of the build log with higher level of verbosity. I don't see Newton.Json being loaded.
Explicitly adding a reference in the build script solves the exception.
#addin nuget:?package=Newtonsoft.Json&version=12.0.1
Log before adding reference.
Preparing to run build script...
Running build script...
Module directory does not exist.
NuGet Config not specified. Will use NuGet default mechanism for resolving it.
Analyzing build script...
Analyzing C:/Projects/Git/myproject/myproject/build.cake...
Analyzing C:/Projects/Git/myproject/myproject/build/environments.cake...
Analyzing C:/Projects/Git/myproject/myproject/build/paths.cake...
Analyzing C:/Projects/Git/myproject/myproject/build/files.cake...
Analyzing C:/Projects/Git/myproject/myproject/build/projecttypes.cake...
Processing build script...
Installing tools...
Installing addins...
The addin Cake.Yarn will reference Cake.Yarn.dll.
The addin Cake.XdtTransform will reference DotNet.Xdt.dll.
The addin Cake.XdtTransform will reference Cake.XdtTransform.dll.
The addin xunit.runner.console will reference xunit.abstractions.dll.
The addin xunit.runner.console will reference xunit.runner.reporters.net452.dll.
The addin xunit.runner.console will reference xunit.runner.utility.net452.dll.
The addin Cake.Issues will reference Cake.Issues.dll.
The addin Cake.Issues.MsBuild will reference Cake.Issues.MsBuild.dll.
The addin Cake.Issues.MsBuild will reference Microsoft.Build.Framework.dll.
The addin Cake.Issues.MsBuild will reference Microsoft.Build.Utilities.Core.dll.
The addin Cake.Issues.MsBuild will reference StructuredLogger.dll.
The addin Cake.Issues.MsBuild will reference System.Collections.Immutable.dll.
The addin Cake.Issues.Reporting will reference Cake.Issues.Reporting.dll.
The addin Cake.Issues.Reporting.Generic will reference Cake.Issues.Reporting.Generic.dll.
The addin Cake.Issues.Reporting.Generic will reference RazorEngine.dll.
The addin Cake.Issues.Reporting.Generic will reference System.Web.Razor.dll.
Verifying assembly 'Cake.Yarn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'DotNet.Xdt, Version=2.1.1.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.XdtTransform, Version=0.18.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'.
Verifying assembly 'xunit.runner.reporters.net452, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'.
Verifying assembly 'xunit.runner.utility.net452, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'.
Verifying assembly 'Cake.Issues, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.Issues.MsBuild, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Verifying assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Verifying assembly 'StructuredLogger, Version=2.0.110.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448'.
Verifying assembly 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Verifying assembly 'Cake.Issues.Reporting, Version=0.8.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.Issues.Reporting.Generic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'RazorEngine, Version=3.10.0.0, Culture=neutral, PublicKeyToken=9ee697374c7e744a'.
Verifying assembly 'System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Adding assembly reference to mscorlib.dll...
Adding assembly reference to System.Core.dll...
Adding assembly reference to Microsoft.CSharp.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Cake.exe...
Adding assembly reference to System.dll...
Adding assembly reference to System.Xml.dll...
Adding assembly reference to System.Xml.Linq.dll...
Adding assembly reference to System.Data.dll...
Adding assembly reference to System.Runtime.dll...
Adding assembly reference to System.Collections.dll...
Adding assembly reference to System.Net.Http.dll...
Adding assembly reference to netstandard.dll...
Adding assembly reference to Cake.Yarn.dll...
Adding assembly reference to DotNet.Xdt.dll...
Adding assembly reference to Cake.XdtTransform.dll...
Adding assembly reference to xunit.abstractions.dll...
Adding assembly reference to xunit.runner.reporters.net452.dll...
Adding assembly reference to xunit.runner.utility.net452.dll...
Adding assembly reference to Cake.Issues.dll...
Adding assembly reference to Cake.Issues.MsBuild.dll...
Adding assembly reference to Microsoft.Build.Framework.dll...
Adding assembly reference to Microsoft.Build.Utilities.Core.dll...
Adding assembly reference to StructuredLogger.dll...
Adding assembly reference to System.Collections.Immutable.dll...
Adding assembly reference to Cake.Issues.Reporting.dll...
Adding assembly reference to Cake.Issues.Reporting.Generic.dll...
Adding assembly reference to RazorEngine.dll...
Adding assembly reference to System.Web.Razor.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TFBuild...
Importing namespace Cake.Common.Build.TFBuild.Data...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Label...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
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...
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.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
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...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace Cake.Issues...
Importing namespace Cake.Issues.MsBuild...
Importing namespace Cake.Issues.Reporting...
Importing namespace Cake.Issues.Reporting.Generic...
Importing namespace Cake.XdtTransform...
Importing namespace Cake.Yarn...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
@bzamora Thanks for the additional information. Explicitly referencing Newtonsoft.Json make sure that it is loaded. I'm still failing to reproduce under which circumstances the assembly is not loaded by Cake itself though. Can you share the script which leads to the above output?
@bzamora I was now finally able to reproduce it in cases where addin versions are pinned and Newtonsoft.Json
is not explicitly loaded in the script.
Can you try to run it without loading Newtonsoft.Json
and without pinning the addin versions, to confirm my findings.
So just use the following (Note that this is just for testing purposes and you should NOT use it like this in production. Pinning is definitely the correct thing to do):
#addin nuget:?package=Cake.Issues
#addin nuget:?package=Cake.Issues.MsBuild
#addin nuget:?package=Cake.Issues.Reporting
#addin nuget:?package=Cake.Issues.Reporting.Generic
@bzamora For the time being loading Newtonsoft.Json
in the script is the correct thing to do in your case. I'll look that I can get rid of JSON.NET completly in the next version of the addin, which should solve this issue also for these cases where Newtonsoft.Json
is not loaded by Cake itself.
@bzamora Version 0.8.2 has been released which should fix this issue.
Trying to use the Generic Report I get the following exception:
Loaded like this: