Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on .NET Framework 4.8 (really) #381

Merged
merged 1 commit into from
May 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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