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

Add .NET 6 and .NET Framework 4.8 targets #3000

Merged
merged 10 commits into from
Oct 28, 2022
Merged
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
3 changes: 2 additions & 1 deletion build-common/NHibernate.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>

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

<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
Expand Down
2 changes: 1 addition & 1 deletion default.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>

<property name="root.dir" value="." />
<property name="bin.target.dir" value="net461" />
<property name="bin.target.dir" value="net48" />
<property name="test.target.dir" value="net48" />

<include buildfile="${root.dir}/build-common/common.xml" />
Expand Down
6 changes: 2 additions & 4 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ Task Set-Configuration {

Task Build {
Exec {
dotnet `
build ./src/NHibernate.sln `
-m:1 `
-c Release
dotnet build ./src/NHibernate/NHibernate.csproj -m:1 -c Release
dotnet build ./src/NHibernate.sln -c Release
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>The Unit Tests for NHibernate.</Description>
<TargetFrameworks>$(NhAppTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);3001;3002;3003;3005;SYSLIB0003;SYSLIB0011;SYSLIB0012</NoWarn>
<NoWarn>$(NoWarn);3001;3002;3003;3005;SYSLIB0003;SYSLIB0012</NoWarn>
<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
4 changes: 4 additions & 0 deletions src/NHibernate/Async/Type/SerializableType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
using NHibernate.Engine;
using NHibernate.SqlTypes;

#if NET6_0_OR_GREATER
#pragma warning disable CS0618 //Serialization is obsolete
#endif

namespace NHibernate.Type
{
using System.Threading.Tasks;
Expand Down
4 changes: 4 additions & 0 deletions src/NHibernate/NHibernate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

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

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/NHibernate/Type/SerializableType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
using NHibernate.Engine;
using NHibernate.SqlTypes;

#if NET6_0_OR_GREATER
#pragma warning disable CS0618 //Serialization is obsolete
#endif

namespace NHibernate.Type
{
/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/NHibernate/Util/SerializationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

#if NET6_0_OR_GREATER
#pragma warning disable CS0618 //Serialization is obsolete
#endif

namespace NHibernate.Util
{
public static partial class SerializationHelper
Expand Down Expand Up @@ -62,4 +66,4 @@ private static BinaryFormatter CreateFormatter()
};
}
}
}
}