Skip to content

Commit d7754f5

Browse files
authored
fix: simulation encoding and NuGet restore (#41)
- Add UTF8 encoding to dotnet run process output/error streams - Increase run timeout from 60s to 120s (NuGet restore needs time) - Remove version glob (10.*) from #r directives (unsupported by dotnet run)
1 parent d6b9071 commit d7754f5

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Services/ClientGeneratorService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ namespace GeneralUpdate.Tools.Services;
1313
public class ClientGeneratorService
1414
{
1515
private const string ClientTemplate = """
16-
#r "nuget: GeneralUpdate.ClientCore, 10.*"
17-
#r "nuget: GeneralUpdate.Core, 10.*"
16+
#r "nuget: GeneralUpdate.ClientCore"
17+
#r "nuget: GeneralUpdate.Core"
1818
1919
using GeneralUpdate.ClientCore;
2020
using GeneralUpdate.Common.Shared.Object;
@@ -72,8 +72,8 @@ public class ClientGeneratorService
7272
""";
7373

7474
private const string UpgradeTemplate = """
75-
#r "nuget: GeneralUpdate.Core, 10.*"
76-
#r "nuget: GeneralUpdate.ClientCore, 10.*"
75+
#r "nuget: GeneralUpdate.Core"
76+
#r "nuget: GeneralUpdate.ClientCore"
7777
7878
using GeneralUpdate.Core;
7979
using GeneralUpdate.Common.Shared;

src/Services/SimulationService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class SimulationService
1818
private readonly ClientGeneratorService _generator = new();
1919
private readonly LocalUpdateServer _server = new();
2020
private readonly StringBuilder _fullLog = new();
21-
private int _timeoutSeconds = 60;
21+
private int _timeoutSeconds = 120;
2222

2323
public IReadOnlyList<string> LogLines => _fullLog.ToString().Split('\n').ToList();
2424

@@ -144,6 +144,8 @@ private void Validate(SimulateConfigModel config)
144144
WorkingDirectory = workDir,
145145
RedirectStandardOutput = true,
146146
RedirectStandardError = true,
147+
StandardOutputEncoding = System.Text.Encoding.UTF8,
148+
StandardErrorEncoding = System.Text.Encoding.UTF8,
147149
UseShellExecute = false,
148150
CreateNoWindow = true
149151
};

0 commit comments

Comments
 (0)