Skip to content

Commit 596f5f1

Browse files
authored
Add .NET Standard target (#59)
1 parent 1697c41 commit 596f5f1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ obj/
33
build/
44
*.nupkg
55
.vs/
6+
.idea/
67
Files.wxs
78
*.wixobj
89
*.wixpdb

src/SharpWebview/Content/HostedContent.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#if NET7_0_OR_GREATER
2+
13
using Microsoft.AspNetCore.Builder;
24
using Microsoft.AspNetCore.Hosting;
35
using Microsoft.AspNetCore.StaticFiles;
@@ -56,3 +58,5 @@ public string ToWebviewUrl()
5658
}
5759
}
5860
}
61+
62+
#endif

src/SharpWebview/SharpWebview.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;net7.0;net8.0;net9.0</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(PublishAot)' == 'true'">net7.0;net8.0;net9.0</TargetFrameworks>
56
<GenerateDocumentationFile>true</GenerateDocumentationFile>
67
<AssemblyName>SharpWebview</AssemblyName>
78
<Authors>Gerrit 'Geaz' Gazic</Authors>
@@ -11,6 +12,7 @@
1112
<PackageVersion>0.12.1</PackageVersion>
1213
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1314
<PackageProjectUrl>https://github.com/webview/webview_csharp</PackageProjectUrl>
15+
<NoWarn>CS1591</NoWarn> <!-- mute missing documentation warnings -->
1416
</PropertyGroup>
1517

1618
<ItemGroup>
@@ -37,8 +39,7 @@
3739
</ItemGroup>
3840

3941
<ItemGroup>
40-
<FrameworkReference Include="Microsoft.AspNetCore.App" />
41-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
42+
<FrameworkReference Include="Microsoft.AspNetCore.App" Condition="'$(TargetFramework)' != 'netstandard2.1'" />
4243
</ItemGroup>
4344

4445
</Project>

0 commit comments

Comments
 (0)