Skip to content

Commit

Permalink
Merge pull request #381 from 0xced/fix-net48-tests
Browse files Browse the repository at this point in the history
Fix tests on .NET Framework 4.8 (really)
  • Loading branch information
skomis-mm authored May 8, 2023
2 parents 5b2b456 + 74ba30e commit 78214e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/Serilog.Settings.Configuration.Tests/Support/TestApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,18 @@ async Task PublishAsync(PublishMode publishMode)

File.WriteAllText(fodyWeaversXml.FullName, publishMode == PublishMode.SingleFile && IsDesktop ? "<Weavers><Costura/></Weavers>" : "<Weavers/>");

var publishArgs = new[] {
var publishArgsBase = new[] {
"publish",
"--no-restore",
"--configuration", "Release",
"--output", outputDirectory.FullName,
$"-p:TargetFramework={TargetFramework}"
};
var autoGenerateBindingRedirects = $"-p:AutoGenerateBindingRedirects={publishMode is PublishMode.Standard}";
var publishSingleFile = $"-p:PublishSingleFile={publishMode is PublishMode.SingleFile or PublishMode.SelfContained}";
var selfContained = $"-p:SelfContained={publishMode is PublishMode.SelfContained}";
await RunDotnetAsync(_workingDirectory, IsDesktop ? publishArgs : publishArgs.Append(publishSingleFile).Append(selfContained).ToArray());
var publishArgs = (IsDesktop ? publishArgsBase.Append(autoGenerateBindingRedirects) : publishArgsBase.Append(publishSingleFile).Append(selfContained)).ToArray();
await RunDotnetAsync(_workingDirectory, publishArgs);

var executableFileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "TestApp.exe" : "TestApp";
var executableFile = new FileInfo(Path.Combine(outputDirectory.FullName, executableFileName));
Expand Down

0 comments on commit 78214e9

Please sign in to comment.