Skip to content

Commit f50c07d

Browse files
authoredOct 28, 2022
Add .NET 6 and .NET Framework 4.8 targets (nhibernate#3000)
1 parent c6677a0 commit f50c07d

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed
 

‎build-common/NHibernate.props

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>
1616

1717
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net48;net6.0</NhAppTargetFrameworks>
18-
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0;netstandard2.1</NhLibTargetFrameworks>
18+
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;net48;netcoreapp2.0;netstandard2.0;netstandard2.1;net6.0</NhLibTargetFrameworks>
1919
<NhNetFx>false</NhNetFx>
2020
<NhNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</NhNetFx>
2121
<!-- Visual Basic requires to use coma (,) as a separator, other project types - semicolon (;) -->
2222
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' != '.vbproj'">NETFX;$(DefineConstants)</DefineConstants>
2323
<DefineConstants Condition="$(NhNetFx) AND '$(MSBuildProjectExtension)' == '.vbproj'">NETFX,$(DefineConstants)</DefineConstants>
24+
<NoWarn Condition="'$(TargetFramework)' == 'net6.0'">$(NoWarn);SYSLIB0011</NoWarn>
2425

2526
<Product>NHibernate</Product>
2627
<Company>NHibernate.info</Company>

‎default.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>
77

88
<property name="root.dir" value="." />
9-
<property name="bin.target.dir" value="net461" />
9+
<property name="bin.target.dir" value="net48" />
1010
<property name="test.target.dir" value="net48" />
1111

1212
<include buildfile="${root.dir}/build-common/common.xml" />

‎psake.ps1

+2-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ Task Set-Configuration {
101101

102102
Task Build {
103103
Exec {
104-
dotnet `
105-
build ./src/NHibernate.sln `
106-
-m:1 `
107-
-c Release
104+
dotnet build ./src/NHibernate/NHibernate.csproj -m:1 -c Release
105+
dotnet build ./src/NHibernate.sln -c Release
108106
}
109107
}
110108

‎src/NHibernate.Test/NHibernate.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>The Unit Tests for NHibernate.</Description>
55
<TargetFrameworks>$(NhAppTargetFrameworks)</TargetFrameworks>
66
<IsTestProject>true</IsTestProject>
7-
<NoWarn>$(NoWarn);3001;3002;3003;3005;SYSLIB0003;SYSLIB0011;SYSLIB0012</NoWarn>
7+
<NoWarn>$(NoWarn);3001;3002;3003;3005;SYSLIB0003;SYSLIB0012</NoWarn>
88
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
99
</PropertyGroup>
1010
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">

‎src/NHibernate/Async/Type/SerializableType.cs

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
using NHibernate.Engine;
1818
using NHibernate.SqlTypes;
1919

20+
#if NET6_0_OR_GREATER
21+
#pragma warning disable CS0618 //Serialization is obsolete
22+
#endif
23+
2024
namespace NHibernate.Type
2125
{
2226
using System.Threading.Tasks;

‎src/NHibernate/NHibernate.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
<Reference Include="Microsoft.CSharp" />
5151
</ItemGroup>
5252

53+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
54+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
55+
</ItemGroup>
56+
5357
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
5458
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
5559
</ItemGroup>

‎src/NHibernate/Type/SerializableType.cs

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
using NHibernate.Engine;
88
using NHibernate.SqlTypes;
99

10+
#if NET6_0_OR_GREATER
11+
#pragma warning disable CS0618 //Serialization is obsolete
12+
#endif
13+
1014
namespace NHibernate.Type
1115
{
1216
/// <summary>

‎src/NHibernate/Util/SerializationHelper.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
using System.Runtime.Serialization;
33
using System.Runtime.Serialization.Formatters.Binary;
44

5+
#if NET6_0_OR_GREATER
6+
#pragma warning disable CS0618 //Serialization is obsolete
7+
#endif
8+
59
namespace NHibernate.Util
610
{
711
public static partial class SerializationHelper
@@ -62,4 +66,4 @@ private static BinaryFormatter CreateFormatter()
6266
};
6367
}
6468
}
65-
}
69+
}

0 commit comments

Comments
 (0)