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

SNOW-798828: Target .NET Standard 2.1 #883

Closed
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net472', 'net471']
dotnet: ['netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net471', 'net472', 'net481']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net5.0', 'net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net5.0', 'net6.0', 'net7.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions Snowflake.Data.Tests/Snowflake.Data.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
<RuntimeFrameworkVersion>6.0.0</RuntimeFrameworkVersion>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net471;net472;net481</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net5.0;net6.0;net7.0;net8.0;</TargetFrameworks>
<RuntimeFrameworkVersion>8.0.0</RuntimeFrameworkVersion>
<Title>Snowflake.Data.Tests</Title>
<Description>Snowflake Connector for .NET</Description>
<Company>Snowflake Computing, Inc</Company>
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data.Tests/Util/SnowflakeDbExceptionAssert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void HasHttpErrorCodeInExceptionChain(Exception exception, HttpSta
case SnowflakeDbException se:
return se.ErrorCode == (int)expected;
case HttpRequestException he:
#if NETFRAMEWORK
#if NETFRAMEWORK || NETCOREAPP
return he.Message.Contains(((int)expected).ToString());
#else
return he.StatusCode == expected;
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data/Core/Authenticator/OktaAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async Task IAuthenticator.AuthenticateAsync(CancellationToken cancellationToken)
s_logger.Debug("step 4: Get SAML response from SSO");
var samlRestRequest = BuildSamlRestRequest(ssoUrl, onetimeToken);
samlRawResponse = await session.restRequester.GetAsync(samlRestRequest, cancellationToken).ConfigureAwait(false);
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD
_rawSamlTokenHtmlString = await samlRawResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
#else
_rawSamlTokenHtmlString = await samlRawResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Expand Down
9 changes: 2 additions & 7 deletions Snowflake.Data/Snowflake.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net471;net472;net481</TargetFrameworks>
<Title>Snowflake.Data</Title>
<PackageId>Snowflake.Data</PackageId>
<PackageLicenseUrl>https://github.com/snowflakedb/snowflake-connector-net/blob/master/LICENSE</PackageLicenseUrl>
Expand Down Expand Up @@ -32,14 +31,10 @@
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net471' Or '$(TargetFramework)' == 'net472'">
<ItemGroup Condition="'$(TargetFramework)' == 'net471' Or '$(TargetFramework)' == 'net472' Or '$(TargetFramework)' == 'net481'">
<Reference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Release'">
<InternalsVisibleTo Include="Snowflake.Data.Tests" />
<!--needed by Moq to be able to mock internal interfaces-->
Expand Down
Loading