Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions sdks/dotnet/BinaryInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ private static async Task<string> ComputeSha256Async(string filePath)
{
using var stream = File.OpenRead(filePath);
using var sha = SHA256.Create();
#if NETSTANDARD2_0
var hash = sha.ComputeHash(stream);
#else
var hash = await sha.ComputeHashAsync(stream);
#endif
return BitConverter.ToString(hash).Replace("-", string.Empty).ToLowerInvariant();
}

Expand All @@ -163,7 +167,15 @@ private static void ExtractArchive(string archivePath, string archiveExt, string
Console.WriteLine($"[TestServerSDK] Extracting {archivePath} to {destDir}...");
if (archiveExt == ".zip")
{
#if NETSTANDARD2_0
if (Directory.Exists(destDir))
{
Directory.Delete(destDir, true);
}
System.IO.Compression.ZipFile.ExtractToDirectory(archivePath, destDir);
#else
System.IO.Compression.ZipFile.ExtractToDirectory(archivePath, destDir, true);
#endif
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions sdks/dotnet/TestServerSdk.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<PackageVersion>0.1.5</PackageVersion>
<PackageVersion>0.1.6</PackageVersion>
<Authors>Google LLC</Authors>
<Description>A .NET SDK to manage the test-server process for integration testing.</Description>
<PackageProjectUrl>https://github.com/google/test-server</PackageProjectUrl>
Expand All @@ -21,6 +21,7 @@
<ItemGroup>
<PackageReference Include="YamlDotNet" Version="12.0.2" />
<PackageReference Include="SharpCompress" Version="0.29.0" />
<PackageReference Include="System.Text.Json" Version="10.0.0" />
</ItemGroup>
<ItemGroup>
<!-- ADD this to embed the file directly into the DLL -->
Expand Down