diff --git a/Directory.Build.props b/Directory.Build.props index 52fa6c08a1..009e8f1dd7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,6 +9,11 @@ enable + + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_OSX()))) + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Windows()))) + + diff --git a/src/AutoMapper/AutoMapper.csproj b/src/AutoMapper/AutoMapper.csproj index fd7eab49a6..6dd0979b5d 100644 --- a/src/AutoMapper/AutoMapper.csproj +++ b/src/AutoMapper/AutoMapper.csproj @@ -29,10 +29,6 @@ --exclude-non-browsable --exclude-compiler-generated - - $(TargetFrameworks);net462 - - diff --git a/src/IntegrationTests/AutoMapper.IntegrationTests.csproj b/src/IntegrationTests/AutoMapper.IntegrationTests.csproj index 72b864934f..ebf9d4200e 100644 --- a/src/IntegrationTests/AutoMapper.IntegrationTests.csproj +++ b/src/IntegrationTests/AutoMapper.IntegrationTests.csproj @@ -7,11 +7,6 @@ true - - true - $(TargetFrameworks);net462 - - diff --git a/src/UnitTests/ArraysAndLists.cs b/src/UnitTests/ArraysAndLists.cs index ce9eaabad8..eb02f5dd4c 100644 --- a/src/UnitTests/ArraysAndLists.cs +++ b/src/UnitTests/ArraysAndLists.cs @@ -159,7 +159,7 @@ public Expression MapExpression(IGlobalConfiguration configurationProvider, Prof MemberMap memberMap, Expression sourceExpression, Expression destExpression) => Expression.Multiply(Expression.Convert(sourceExpression, typeof(int)), Expression.Constant(1000)); -#if NET481 +#if NET471_OR_GREATER public TypePair? GetAssociatedTypes(TypePair initialTypes) => null; #endif } diff --git a/src/UnitTests/AutoMapper.UnitTests.csproj b/src/UnitTests/AutoMapper.UnitTests.csproj index 31e14ffddd..5e37fcc40c 100644 --- a/src/UnitTests/AutoMapper.UnitTests.csproj +++ b/src/UnitTests/AutoMapper.UnitTests.csproj @@ -9,7 +9,7 @@ true - $(TargetFrameworks);net462 + $(TargetFrameworks);net471 diff --git a/src/UnitTests/ForPath.cs b/src/UnitTests/ForPath.cs index 0c944747e6..eb45f2b165 100644 --- a/src/UnitTests/ForPath.cs +++ b/src/UnitTests/ForPath.cs @@ -254,7 +254,7 @@ public void Should_throw_exception() { var cfg = new MapperConfiguration(config => { - Assert.Throws(() => + Assert.Throws(() => { config.CreateMap() .ForPath(sourceModel => sourceModel.Name, opts => opts.MapFrom(null)); diff --git a/src/UnitTests/Mappers/CustomMapperTests.cs b/src/UnitTests/Mappers/CustomMapperTests.cs index e97b0e6230..975b5fe99c 100644 --- a/src/UnitTests/Mappers/CustomMapperTests.cs +++ b/src/UnitTests/Mappers/CustomMapperTests.cs @@ -67,7 +67,7 @@ public Expression MapExpression(IGlobalConfiguration configurationProvider, Prof return expr.Body; } -#if NET481 +#if NET471_OR_GREATER public TypePair? GetAssociatedTypes(TypePair initialTypes) => null; #endif }