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

Removing NetStandard support for OMEX #650

Merged
merged 23 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<OldestSupportedDotNetVersion>net8.0</OldestSupportedDotNetVersion>
<NetCoreVersions>$(LatestSupportedDotNetVersion)</NetCoreVersions>
<NetCoreVersions Condition="'$(LatestSupportedDotNetVersion)' != '$(OldestSupportedDotNetVersion)'">$(LatestSupportedDotNetVersion);$(OldestSupportedDotNetVersion)</NetCoreVersions>
<NetStandardVersions>netstandard2.0</NetStandardVersions>
neilr81 marked this conversation as resolved.
Show resolved Hide resolved
<LibraryTargetFrameworks>$(NetCoreVersions);$(NetStandardVersions)</LibraryTargetFrameworks>
<LibraryTargetFrameworks>$(NetCoreVersions)</LibraryTargetFrameworks>
<ExecutableTargetFrameworks>$(NetCoreVersions)</ExecutableTargetFrameworks>
</PropertyGroup>
<PropertyGroup Label="UnitTest Targets">
Expand Down
37 changes: 0 additions & 37 deletions src/Abstractions/NetStandardCompatability.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Abstractions/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static string ThrowIfNullOrWhiteSpace(string? value, string? name = null)
{
if (!string.IsNullOrWhiteSpace(value))
{
return value!; // `!` required because in netstandard2.0 IsNullOrWhiteSpace does not have proper attributes
return value;
}

_ = value ?? throw new ArgumentNullException(name);
Expand Down
2 changes: 1 addition & 1 deletion src/Activities/Internal/ActivityLoggerHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static StringBuilder AppendParamName(this StringBuilder builder, string n
builder.Append(name).Append(':');

/// <summary>
/// Appends collection of key value pairs to StringBuilder, by calling ToSting on key and value
/// Appends collection of key value pairs to StringBuilder, by calling ToString on key and value
/// </summary>
/// <remarks>
/// TODO: should be replaced by AppendJoin when we remove netstandard target, since KeyValuePair also overrides ToString
neilr81 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,12 @@ private static HttpRequestMessage CloneRequestMessage(HttpRequestMessage message
clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
}

#if !NETCOREAPP3_1 && !NETSTANDARD2_0
clone.VersionPolicy = message.VersionPolicy;

foreach (KeyValuePair<string, object?> option in message.Options)
{
clone.Options.Set(new HttpRequestOptionsKey<object?>(option.Key), option.Value);
}
#else
foreach (KeyValuePair<string, object> prop in message.Properties)
{
clone.Properties.Add(prop.Key, prop.Value);
}
#endif

return clone;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@
<ProjectReference Include="..\..\src\Testing.Helpers\Microsoft.Omex.Extensions.Testing.Helpers.csproj" />
<ProjectReference Include="..\Abstractions.UnitTests\Microsoft.Omex.Extensions.Abstractions.UnitTests.csproj" />
</ItemGroup>
<ItemGroup Condition="$(IsNetFramework)">
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@
<PackageReference Include="Newtonsoft.Json" /> <!-- Bump version of transitive dependency -->
<PackageReference Include="ServiceFabric.Mocks" />
</ItemGroup>
<ItemGroup Condition="$(IsNetFramework)">
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>