diff --git a/src/Cake/Scripting/Roslyn/Nightly/DebugRoslynNightlyScriptSession.cs b/src/Cake/Scripting/Roslyn/Nightly/DebugRoslynNightlyScriptSession.cs index 4d9b176876..2aaa9841fe 100644 --- a/src/Cake/Scripting/Roslyn/Nightly/DebugRoslynNightlyScriptSession.cs +++ b/src/Cake/Scripting/Roslyn/Nightly/DebugRoslynNightlyScriptSession.cs @@ -77,7 +77,7 @@ public override void Execute(Script script) _log.Verbose("Compilation failed"); var errors = string.Join(Environment.NewLine, result.Diagnostics.Select(x => x.ToString())); - var message = string.Format("Error occurred when compiling: {0}", errors); + var message = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Error occurred when compiling: {0}", errors); throw new CakeException(message); } diff --git a/src/Cake/Scripting/Roslyn/Stable/DebugRoslynScriptSession.cs b/src/Cake/Scripting/Roslyn/Stable/DebugRoslynScriptSession.cs index 744f40f72b..9b521ce792 100644 --- a/src/Cake/Scripting/Roslyn/Stable/DebugRoslynScriptSession.cs +++ b/src/Cake/Scripting/Roslyn/Stable/DebugRoslynScriptSession.cs @@ -60,7 +60,7 @@ public override void Execute(Script script) _log.Verbose("Compilation failed"); var errors = string.Join(Environment.NewLine, result.Diagnostics.Select(x => x.ToString())); - var message = string.Format("Error occurred when compiling: {0}", errors); + var message = string.Format(System.Globalization.CultureInfo.InvariantCulture, "Error occurred when compiling: {0}", errors); throw new CakeException(message); }