cake-build/example

Cake.Json addin problem with Cake.Build 0.22.2

gabornemeth opened this issue · 2 comments

I'm experiencing a problem with Cake.Build 0.22.2 and using the Cake.Json addin.
If I'm trying to build the actual example repository after adding #addin Cake.Json into the build.cake script, I get the following error:

Compiling build script...
Error: Error occurred when compiling build script: error CS0246: The type or namespace name 'Newtonsoft' could not be fo
und (are you missing a using directive or an assembly reference?)
(2431,8): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or
 an assembly reference?)
(2437,8): error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or
 an assembly reference?)
(2433,12): error CS0012: The type 'JObject' is defined in an assembly that is not referenced. You must add a reference t
o assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
(2439,12): error CS0012: The type 'JObject' is defined in an assembly that is not referenced. You must add a reference t
o assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.

The workaround I'm using is stick to version 0.21.1 and use #addin nuget:?package=Cake.Json&version=1.0.2.13

Hi @gabornemeth,

This issue belongs in Redth/Cake.Json repository, please raise an issue there to make the addin author aware of the issue.

Could be that this is a duplicate of issue cake-contrib/Cake.Json#15 and the author @Redth is already aware of the issue.

I'm going to go ahead and close this issue as it's unrelated to Cake's example repo.

I managed to get around this problem by simply adding to Build.cake the following:

#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json"
using Newtonsoft.Json;