diff --git a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/DebugProgram/MonoStartDebuggingOptionsPageBase.cs b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/DebugProgram/MonoStartDebuggingOptionsPageBase.cs index d5a5ada7f3..0168f536e1 100644 --- a/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/DebugProgram/MonoStartDebuggingOptionsPageBase.cs +++ b/Extensions/dnSpy.Debugger/dnSpy.Debugger.DotNet.Mono/Dialogs/DebugProgram/MonoStartDebuggingOptionsPageBase.cs @@ -172,6 +172,8 @@ protected void Initialize(MonoStartDebuggingOptionsBase options) { CommandLine = options.CommandLine ?? string.Empty; // Must be init'd after Filename since it also overwrites this property WorkingDirectory = options.WorkingDirectory ?? string.Empty; + Environment.Clear(); + Environment.AddRange(options.Environment.Environment); ConnectionPort.Value = options.ConnectionPort; ConnectionTimeout.Value = (uint)options.ConnectionTimeout.TotalSeconds; BreakKind = FilterBreakKind(options.BreakKind); @@ -185,6 +187,8 @@ protected void GetOptions(MonoStartDebuggingOptionsBase options) { options.Filename = Filename; options.CommandLine = CommandLine; options.WorkingDirectory = WorkingDirectory; + options.Environment.Clear(); + options.Environment.AddRange(Environment.Environment); options.ConnectionPort = ConnectionPort.Value; options.ConnectionTimeout = TimeSpan.FromSeconds(ConnectionTimeout.Value); options.BreakKind = FilterBreakKind(BreakKind);