You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cake.Issues.Reporting.Generic addin expects Newtonsoft.Json.dll to be loaded into AppDomain and uses it to compile Razor templates. When all addins used in the script are pinned this is not the case. As soon as at least one addin is not pinned Newtonsoft.Json.dll is loaded into the app domain.
The Cake.Issues.Reporting.Generic addin uses RazorEngine compiling a Razor template which uses JSON.NET. For this it looks in the current AppDomain for Newtonsoft.Json.dll (see this line in Cake.Issues.Reporting.Generic and this line in RazorEngine).
Newtonsoft.Json.dll should always be loaded into the AppDomain by Cake
What version of Cake are you using?
Cake 0.35.0 on .NET Framework 4.7.2
Are you running on a 32 or 64 bit system?
64-Bit
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
How Did You Get This To Happen? (Steps to Reproduce)
// Fails
#addin Cake.Issues&version=0.8.0
#addin Cake.Issues.Reporting&version=0.8.0
#addin Cake.Issues.Reporting.Generic&version=0.8.1
// Works as soon as one of the lines above is replaced with any of those lines
// #addin Cake.Issues
// #addin nuget:?package=Cake.Issues
// #addin Cake.Issues.Reporting
// #addin nuget:?package=Cake.Issues.Reporting
// #addin Cake.Issues.Reporting.Generic
// #addin nuget:?package=Cake.Issues.Reporting.Generic
Task("Default")
.Does(() =>
{
var repoRootFolder = MakeAbsolute(Directory("./"));
var issues = new List<IIssue>();
var settings =
GenericIssueReportFormatSettings
.FromEmbeddedTemplate(GenericIssueReportTemplate.HtmlDxDataGrid);
CreateIssueReport(
issues,
GenericIssueReportFormat(settings),
repoRootFolder,
repoRootFolder.CombineWithFilePath("report.html"));
});
RunTarget("Default");
Output Log
Preparing to run build script...
Addin compatibility check is disabled
Running build script...
========================================
Default
========================================
Creating report 'C:/temp/3/tools/report.html'
Could not find loaded assembly Newtonsoft.Json.dll.
An error occurred when executing task 'Default'.
Error: One or more errors occurred.
Could not find loaded assembly Newtonsoft.Json.dll.
The text was updated successfully, but these errors were encountered:
pascalberger
changed the title
Newtonsoft.Json.dll not loaded in AppDomain when pinging addins
Newtonsoft.Json.dll not loaded in AppDomain when addins are pinned
Oct 16, 2020
What You Are Seeing?
Cake.Issues.Reporting.Generic addin expects
Newtonsoft.Json.dll
to be loaded into AppDomain and uses it to compile Razor templates. When all addins used in the script are pinned this is not the case. As soon as at least one addin is not pinnedNewtonsoft.Json.dll
is loaded into the app domain.The Cake.Issues.Reporting.Generic addin uses RazorEngine compiling a Razor template which uses JSON.NET. For this it looks in the current AppDomain for
Newtonsoft.Json.dll
(see this line in Cake.Issues.Reporting.Generic and this line in RazorEngine).Originally reporting in cake-contrib/Cake.Issues.Reporting.Generic#240
What is Expected?
Newtonsoft.Json.dll
should always be loaded into the AppDomain by CakeWhat version of Cake are you using?
Cake 0.35.0 on .NET Framework 4.7.2
Are you running on a 32 or 64 bit system?
64-Bit
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
How Did You Get This To Happen? (Steps to Reproduce)
Output Log
The text was updated successfully, but these errors were encountered: