cake-contrib / Cake.Issues.Reporting.Generic

:cake: :jigsaw: :mag_right: Addin for creating text based issue reports (HTML, Markdown, ...)
https://cakeissues.net
Other
1 stars 8 forks source link

Could not find loaded assembly Newtonsoft.Json.dll #240

Closed bzamora closed 4 years ago

bzamora commented 4 years ago

Trying to use the Generic Report I get the following exception:


========================================
MSBuildReport
========================================
Executing task: MSBuildReport
Initialize issue provider MsBuildIssuesProvider...
Reading issues from MsBuildIssuesProvider...
Found 0 issues using issue provider MsBuildIssuesProvider...
Initialize report format GenericIssueReportGenerator...
Creating report GenericIssueReportGenerator...
Creating report 'artifacts/Release/msbuildreport.html'
Could not find loaded assembly Newtonsoft.Json.dll.
An error occurred when executing task 'MSBuildReport'.
Error: System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Could not find loaded assembly Newtonsoft.Json.dll.
   at Cake.Issues.Reporting.Generic.RazorEngineReferenceResolver.FindLoaded(IEnumerable`1 refs, String find) in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\RazorEngineReferenceResolver.cs:line 45
   at Cake.Issues.Reporting.Generic.RazorEngineReferenceResolver.<GetReferences>d__0.MoveNext() in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\RazorEngineReferenceResolver.cs:line 31
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at RazorEngine.Compilation.CompilerServiceBase.GetAllReferences(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.Compile(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileTypeImpl(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType_Windows(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context)
   at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType)
   at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Cake.Issues.Reporting.Generic.GenericIssueReportGenerator.InternalCreateReport(IEnumerable`1 issues) in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\GenericIssueReportGenerator.cs:line 57
   at Submission#0.CreateIssueReport(IEnumerable`1 issueProviders, IIssueReportFormat reportFormat, DirectoryPath repositoryRoot, FilePath outputFilePath)
   at Submission#0.<<Initialize>>b__0_15()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass24_0.<Does>b__0(ICakeContext x)
   at Cake.Core.CakeTask.<Execute>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.CakeEngine.<RunTask>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Cake.Core.CakeEngine.<RunTargetAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.Scripting.ScriptHost.RunTarget(String target)
   at Submission#0.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Cake.Scripting.Roslyn.RoslynScriptSession.Execute(Script script)
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
   at Cake.Commands.BuildCommand.Execute(CakeOptions options)
   at Cake.CakeApplication.Run(CakeOptions options)
   at Cake.Program.Main()
---> (Inner Exception #0) System.InvalidOperationException: Could not find loaded assembly Newtonsoft.Json.dll.
   at Cake.Issues.Reporting.Generic.RazorEngineReferenceResolver.FindLoaded(IEnumerable`1 refs, String find) in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\RazorEngineReferenceResolver.cs:line 45
   at Cake.Issues.Reporting.Generic.RazorEngineReferenceResolver.<GetReferences>d__0.MoveNext() in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\RazorEngineReferenceResolver.cs:line 31
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at RazorEngine.Compilation.CompilerServiceBase.GetAllReferences(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.Compile(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileTypeImpl(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType_Windows(TypeContext context)
   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context)
   at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType)
   at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Cake.Issues.Reporting.Generic.GenericIssueReportGenerator.InternalCreateReport(IEnumerable`1 issues) in C:\projects\cake-issues-reporting-generic\src\Cake.Issues.Reporting.Generic\GenericIssueReportGenerator.cs:line 57
   at Submission#0.CreateIssueReport(IEnumerable`1 issueProviders, IIssueReportFormat reportFormat, DirectoryPath repositoryRoot, FilePath outputFilePath)
   at Submission#0.<<Initialize>>b__0_15()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass24_0.<Does>b__0(ICakeContext x)
   at Cake.Core.CakeTask.<Execute>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.CakeEngine.<RunTask>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Cake.Core.CakeEngine.<RunTargetAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cake.Core.Scripting.ScriptHost.RunTarget(String target)
   at Submission#0.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()<---

Loaded like this:

#addin nuget:?package=Cake.Issues&version=0.8.0&loaddependencies=true
#addin nuget:?package=Cake.Issues.MsBuild&version=0.8.0&loaddependencies=true
#addin nuget:?package=Cake.Issues.Reporting&version=0.8.0&loaddependencies=true
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=0.8.1&loaddependencies=true
pascalberger commented 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.

bzamora commented 4 years ago

Cake 0.35.0, Windows 10.0.11763 Build 17763

pascalberger commented 4 years ago

Moved the issue to the Cake.Issues.Reporting.Generic repository as it is an issue with this addin.

pascalberger commented 4 years ago

@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?

bzamora commented 4 years ago

@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.

bzamora commented 4 years ago

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...
pascalberger commented 4 years ago

@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?

pascalberger commented 4 years ago

@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
pascalberger commented 4 years ago

@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.

pascalberger commented 4 years ago

@bzamora Version 0.8.2 has been released which should fix this issue.