Config variables replacement fails with json --> unexpected char

Hello,

I have .json which looks like this:
“Serilog”: {
“Using”: [ “Serilog.Sinks.EventLog”, “Serilog.Settings.Configuration” ],
“Filter”: [

Currently when I try to replace the “Serilog:Using” I have this configuration:

Questions:

  1. How to get across this Error: Unable to set value for Serilog:Using. The following error occurred: Unexpected character encountered while parsing value: S. Path ‘’, line 0, position 0.
  2. How what will happen with the other Values like “Serilog.Sinks.EventLog” --> how can I delete this Value?

Regards
Alex

Hi Alex. Thanks for getting in touch!

You already have the right approach here to remove the Serilog.Sinks.EventLog value, because Octopus will replace the entire value of Using with the variable.

The error is occurring because the variable’s value is interpreted as a literal JSON value, so it’s trying to build this, which wouldn’t be valid JSON:

ScreenClip

To match the existing format of that value (an array containing strings), add the JSON delimiters to your variable’s value, like this:

["Serilog.Settings.Configuration"]

I hope that helps. Please let us know if there are any more problems.

Regards,
David

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.