we’ve updated Octopus to version 2018.9.16 and we’d like to leverage Referencing Packages feature to use Newtonsoft.Json library.
In short, we’ve got a deploy step written in C#, this step has a referenced package from Nuget feed (uploaded secure Octopus way), Newtonsoft.Json library. Inside the C# script we’ve tried to use
r# Newtonsoft.Json and
using Newtonsoft.Json;, in both cases the step fails.
using Newtonsoft.Json;, it throws error:
[CompilationErrorException] error CS0246: The type or namespace name ‘Newtonsoft’ could not be found (are you missing a using directive or an assembly reference?)
#r Newtonsoft.Jsonthe error we receive is:
[FileNotFoundException] Assembly not found.
#r "./Newtonsoft.Json/lib/net45/Newtonsoft.Json.dll" way seems to have worked for us, but is it an expected correct way to do this? Or are we missing something?
Thanks in advance.