Skip to content

Commit

Permalink
Merge pull request #5869 from aspnetboilerplate/net5
Browse files Browse the repository at this point in the history
Upgrade to .NET 5 (WIP)
  • Loading branch information
ismcagdas committed Nov 10, 2020
2 parents 1a98202 + 3469bd3 commit 511ed63
Show file tree
Hide file tree
Showing 120 changed files with 535 additions and 382 deletions.
20 changes: 20 additions & 0 deletions Delete-BIN-OBJ-Folders.bat
@@ -0,0 +1,20 @@
@ECHO off
cls

ECHO Deleting all BIN and OBJ folders...
ECHO.

FOR /d /r . %%d in (bin,obj) DO (
IF EXIST "%%d" (
ECHO %%d | FIND /I "\node_modules\" > Nul && (
ECHO.Skipping: %%d
) || (
ECHO.Deleting: %%d
rd /s/q "%%d"
)
)
)

ECHO.
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit.
pause > nul
14 changes: 7 additions & 7 deletions build/_build.csproj
Expand Up @@ -2,24 +2,24 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGet.CommandLine" Version="5.6.0">
<PackageReference Include="NuGet.CommandLine" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Nuke.Common" Version="0.24.11" />
<PackageReference Include="Nuke.Common" Version="0.25.0" />

<PackageReference Include="Microsoft.Build" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.6.0" />
<PackageReference Include="Microsoft.Build" Version="16.7.0" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.7.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.7.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions build/_build.csproj.DotSettings
Expand Up @@ -14,6 +14,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ANONYMOUSMETHOD_ON_SINGLE_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion common.props
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.14.0</Version>
<Version>6.0.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageIconUrl>http://www.aspnetboilerplate.com/images/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>http://www.aspnetboilerplate.com/</PackageProjectUrl>
Expand Down
8 changes: 6 additions & 2 deletions src/Abp.AspNetCore.OData/Abp.AspNetCore.OData.csproj
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.AspNetCore.OData</AssemblyName>
<PackageId>Abp.AspNetCore.OData</PackageId>
Expand All @@ -25,7 +25,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.5.0" />
<PackageReference Include="Microsoft.AspNetCore.OData" Version="7.5.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Abp.AspNetCore.SignalR/Abp.AspNetCore.SignalR.csproj
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.AspNetCore.SignalR</AssemblyName>
<PackageId>Abp.AspNetCore.SignalR</PackageId>
Expand All @@ -25,4 +25,8 @@
<ProjectReference Include="..\Abp\Abp.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
8 changes: 6 additions & 2 deletions src/Abp.AspNetCore.TestBase/Abp.AspNetCore.TestBase.csproj
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.AspNetCore.TestBase</AssemblyName>
<PackageId>Abp.AspNetCore.TestBase</PackageId>
Expand All @@ -24,7 +24,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.5" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
10 changes: 7 additions & 3 deletions src/Abp.AspNetCore/Abp.AspNetCore.csproj
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.AspNetCore</AssemblyName>
<PackageId>Abp.AspNetCore</PackageId>
Expand Down Expand Up @@ -34,8 +34,12 @@
<ItemGroup>
<PackageReference Include="Castle.LoggingFacility.MsLogging" Version="3.1.0" />
<PackageReference Include="Castle.Windsor.MsDependencyInjection" Version="3.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.5"></PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Abp.AutoMapper/Abp.AutoMapper.csproj
Expand Up @@ -24,8 +24,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.0.0" />
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="AutoMapper.Collection" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Abp.Castle.Log4Net/Abp.Castle.Log4Net.csproj
Expand Up @@ -21,7 +21,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="log4net" Version="2.0.12" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions src/Abp.Dapper/Abp.Dapper.csproj
Expand Up @@ -23,4 +23,8 @@
<PackageReference Include="DapperExtensions.DotnetCore" Version="1.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
Expand Up @@ -20,4 +20,8 @@
<ProjectReference Include="..\Abp\Abp.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
Expand Up @@ -14,6 +14,7 @@
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<RootNamespace>Abp.EntityFramework</RootNamespace>
<Description>Abp.EntityFramework.GraphDiff</Description>
<UserSecretsId>9c1c3adb-b823-4583-9c4f-bd57476d8015</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,7 +24,7 @@

<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="RefactorThis.GraphDiff" Version="3.1.2" />
<PackageReference Include="RefactorThis.GraphDiff" Version="3.1.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand All @@ -33,6 +34,7 @@

<ItemGroup>
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Abp.EntityFramework/Abp.EntityFramework.csproj
Expand Up @@ -40,6 +40,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.EntityFrameworkCore.EFPlus</AssemblyName>
<PackageId>Abp.EntityFrameworkCore.EFPlus</PackageId>
Expand All @@ -21,11 +21,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.52" />
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.0.0-preview.8.20407.4-05" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Abp\Abp.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
10 changes: 7 additions & 3 deletions src/Abp.EntityFrameworkCore/Abp.EntityFrameworkCore.csproj
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Abp.EntityFrameworkCore</AssemblyName>
<PackageId>Abp.EntityFrameworkCore</PackageId>
Expand All @@ -25,8 +25,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
Expand Up @@ -17,8 +17,7 @@ public IEnumerable<EntityTypeInfo> GetEntityTypeInfos(Type dbContextType)
return
from property in dbContextType.GetProperties(BindingFlags.Public | BindingFlags.Instance)
where
(ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbSet<>)) ||
ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbQuery<>))) &&
ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbSet<>)) &&
ReflectionHelper.IsAssignableToGenericType(property.PropertyType.GenericTypeArguments[0],
typeof(IEntity<>))
select new EntityTypeInfo(property.PropertyType.GenericTypeArguments[0], property.DeclaringType);
Expand Down
Expand Up @@ -53,7 +53,7 @@ public class EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey> :
protected virtual IQueryable<TEntity> GetQueryable()
{
if (EntityIsDbQuery.GetOrAdd(typeof(TEntity), key => Context.GetType().GetProperties().Any(property =>
ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbQuery<>)) &&
ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbSet<>)) &&
ReflectionHelper.IsAssignableToGenericType(property.PropertyType.GenericTypeArguments[0],
typeof(IEntity<>)) &&
property.PropertyType.GetGenericArguments().Any(x => x == typeof(TEntity)))))
Expand Down
5 changes: 3 additions & 2 deletions src/Abp.FluentMigrator/Abp.FluentMigrator.csproj
Expand Up @@ -24,8 +24,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentMigrator" Version="3.2.7" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.7" />
<PackageReference Include="FluentMigrator" Version="3.2.9" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.9" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand All @@ -35,6 +35,7 @@

<ItemGroup>
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Abp.FluentValidation/Abp.FluentValidation.csproj
Expand Up @@ -25,7 +25,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.6.2" />
<PackageReference Include="FluentValidation" Version="9.3.0-preview2" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
Expand Up @@ -27,7 +27,7 @@ public override void Initialize()

public override void PostInitialize()
{
ValidatorOptions.LanguageManager = IocManager.Resolve<AbpFluentValidationLanguageManager>();
ValidatorOptions.Global.LanguageManager = IocManager.Resolve<AbpFluentValidationLanguageManager>();
}
}
}
Expand Up @@ -19,11 +19,13 @@ public IReadOnlyList<ValidationResult> Validate(object validatingObject)
{
var validationErrors = new List<ValidationResult>();

var fvValidator = _validatorFactory.GetValidator(validatingObject.GetType());
IValidator fvValidator = _validatorFactory.GetValidator(validatingObject.GetType());

if (fvValidator != null)
{
var validationResult = fvValidator.Validate(validatingObject);
var validationContext = new ValidationContext<object>(validatingObject);
var validationResult = fvValidator.Validate(validationContext);

var mappedValidationErrors = validationResult.Errors
.Select(e => new ValidationResult(e.ErrorMessage, new[] { e.PropertyName }))
.ToList();
Expand Down
6 changes: 5 additions & 1 deletion src/Abp.HangFire.AspNetCore/Abp.HangFire.AspNetCore.csproj
Expand Up @@ -17,8 +17,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.15" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.17" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Abp.HangFire/Abp.HangFire.csproj
Expand Up @@ -24,7 +24,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hangfire.Core" Version="1.7.15" />
<PackageReference Include="Hangfire.Core" Version="1.7.17" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-20204-02" />
</ItemGroup>

</Project>

0 comments on commit 511ed63

Please sign in to comment.