Skip to content

Commit 4bee63b

Browse files
authored
Fix runtime error when using lib in netframework app. (#44)
1 parent 5483c77 commit 4bee63b

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

build.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
set -e
44

5-
# Restore packages
6-
dotnet restore
7-
85
# Build
9-
dotnet build --configuration Release
6+
dotnet build src/Winton.Extensions.Configuration.Consul --configuration Release --framework netstandard2.0
7+
dotnet build test/Winton.Extensions.Configuration.Consul.Test --configuration Release --framework netcoreapp2.0
8+
dotnet build test/Website --configuration Release --framework netcoreapp2.0
109

1110
# Unit Test
12-
dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --configuration Release
11+
dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --no-restore --configuration Release
1312

1413
# Integration test
1514
if hash docker 2>/dev/null; then

src/Winton.Extensions.Configuration.Consul/Winton.Extensions.Configuration.Consul.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageVersion>$(NuGetVersion)</PackageVersion>
1818
<RepositoryType>git</RepositoryType>
1919
<RepositoryUrl>https://github.com/wintoncode/Winton.Extensions.Configuration.Consul</RepositoryUrl>
20-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
20+
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
2121
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
2222
<WriteVersionInfoToBuildLog>False</WriteVersionInfoToBuildLog>
2323
</PropertyGroup>
@@ -37,5 +37,11 @@
3737
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
3838
</ItemGroup>
3939

40+
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
41+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Net.Http.WebRequest" />
44+
</ItemGroup>
45+
4046
</Project>
4147

0 commit comments

Comments
 (0)