Skip to content

Commit cc351d5

Browse files
authored
Merge pull request #23609 from abpframework/net10.0
Upgrade to .NET 10.0.
2 parents dfa8d21 + 019cf1e commit cc351d5

File tree

748 files changed

+2309
-8113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

748 files changed

+2309
-8113
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- uses: actions/checkout@v2
5555
- uses: actions/setup-dotnet@master
5656
with:
57-
dotnet-version: 9.0.100
57+
dotnet-version: 10.0.x
5858

5959
- name: Build All
6060
run: ./build-all.ps1

Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
<ItemGroup>
77
<PackageReference Condition="'$(IsTestProject)' == 'true'" Include="coverlet.collector">
8-
<PrivateAssets>all</PrivateAssets>
9-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
8+
<Version Condition="$(MSBuildProjectFullPath.Contains('templates'))">6.0.4</Version>
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1011
</PackageReference>
1112
</ItemGroup>
1213

Directory.Packages.props

Lines changed: 118 additions & 117 deletions
Large diffs are not rendered by default.

abp_io/AbpIoLocalization/AbpIoLocalization.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="AbpIoLocalization/AbpIoLocalization.csproj" />
3+
</Solution>

abp_io/AbpIoLocalization/AbpIoLocalization/AbpIoLocalization.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

docs/en/docs-nav.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@
603603
{
604604
"text": "Storage Providers",
605605
"items": [
606+
{
607+
"text": "Memory Provider",
608+
"path": "framework/infrastructure/blob-storing/memory.md"
609+
},
606610
{
607611
"text": "File System Provider",
608612
"path": "framework/infrastructure/blob-storing/file-system.md"

docs/en/framework/fundamentals/caching.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ Configure<AbpDistributedCacheOptions>(options =>
224224

225225
> Write that code inside the `ConfigureServices` method of your [module class](../architecture/modularity/basics.md).
226226
227-
#### Available Options
228227

229-
* `HideErrors` (`bool`, default: `true`): Enables/disables hiding the errors on writing/reading values from the cache server.
228+
* `HideErrors` (`bool`, default: `true`): Enables or disables hiding errors when reading from or writing to the cache server. In the **development** environment, this option is **disabled** to help developers detect and fix any cache server issues.
230229
* `KeyPrefix` (`string`, default: `null`): If your cache server is shared by multiple applications, you can set a prefix for the cache keys for your application. In this case, different applications can not overwrite each other's cache items.
231230
* `GlobalCacheEntryOptions` (`DistributedCacheEntryOptions`): Used to set default distributed cache options (like `AbsoluteExpiration` and `SlidingExpiration`) used when you don't specify the options while saving cache items. The default value uses the `SlidingExpiration` as 20 minutes.
232231

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# BLOB Storing Memory Provider
2+
3+
Memory Storage Provider is used to store BLOBs in the memory. This is mainly used for unit testing purposes.
4+
5+
> Read the [BLOB Storing document](../blob-storing) to understand how to use the BLOB storing system. This document only covers how to configure containers to use the memory.
6+
7+
## Installation
8+
9+
Use the ABP CLI to add [Volo.Abp.BlobStoring.Memory](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Memory) NuGet package to your project:
10+
11+
* Install the [ABP CLI](../../../cli) if you haven't installed before.
12+
* Open a command line (terminal) in the directory of the `.csproj` file you want to add the `Volo.Abp.BlobStoring.Memory` package.
13+
* Run `abp add-package Volo.Abp.BlobStoring.Memory` command.
14+
15+
If you want to do it manually, install the [Volo.Abp.BlobStoring.Memory](https://www.nuget.org/packages/Volo.Abp.BlobStoring.Memory) NuGet package to your project and add `[DependsOn(typeof(AbpBlobStoringMemoryModule))]` to the [ABP module](../../architecture/modularity/basics.md) class inside your project.
16+
17+
## Configuration
18+
19+
Configuration is done in the `ConfigureServices` method of your [module](../../architecture/modularity/basics.md) class, as explained in the [BLOB Storing document](../blob-storing).
20+
21+
**Example: Configure to use the Memory storage provider by default**
22+
23+
````csharp
24+
Configure<AbpBlobStoringOptions>(options =>
25+
{
26+
options.Containers.ConfigureDefault(container =>
27+
{
28+
container.UseMemory();
29+
});
30+
});
31+
````
32+
33+
`UseMemory` extension method is used to set the Memory Provider for a container.
34+
35+
> See the [BLOB Storing document](../blob-storing) to learn how to configure this provider for a specific container.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# ABP Version 10.0 Migration Guide
2+
3+
This document is a guide for upgrading ABP v9.x solutions to ABP v10.0. There are some changes in this version that may affect your applications, please read it carefully and apply the necessary changes to your application.
4+
5+
## Open-Source (Framework)
6+
7+
### Upgraded to .NET 10.0
8+
9+
We've upgraded ABP to .NET 10.0, so you need to move your solutions to .NET 10.0 if you want to use ABP 10.0. You can check Microsoft’s [Migrate from ASP.NET Core 9.0 to 10.0](https://learn.microsoft.com/en-us/aspnet/core/migration/90-to-100) documentation, to see how to update an existing ASP.NET Core 9.0 project to ASP.NET Core 10.0.
10+
11+
### Razor Runtime Compilation Obsolete
12+
13+
We removed the Razor Runtime Compilation support.
14+
15+
For more information, you can check the [Razor Runtime Compilation Obsolete](https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/10/razor-runtime-compilation-obsolete) page.
16+
17+
### IActionContextAccessor Obsolete
18+
19+
We removed the `IActionContextAccessor` from dependency injection.
20+
21+
> We are not using `IActionContextAccessor` in ABP core framework and modules.
22+
23+
See [IActionContextAccessor Obsolete](https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/10/iactioncontextaccessor-obsolete) for more information.
24+
25+
### Add `BLOB Storing Memory Provider` module.
26+
27+
In this version, we added the `BLOB Storing Memory Provider` module for unit testing purposes.
28+
29+
See the [BLOB Storing Memory Provider](https://github.com/abpframework/abp/blob/dev/docs/en/framework/infrastructure/blob-storing/memory.md) document for more information.
30+
31+
### Always use `MapStaticAssets`
32+
33+
Provious, the `MapStaticAssets` has performance problems if there are too many static files. and we will use `StaticFileMiddleware` to serve the static files in development mode. NET 10.0 has fixed this problem. We will always use `MapStaticAssets` to serve the static files.
34+
35+
See [Static file serving performance issues](https://github.com/dotnet/aspnetcore/issues/59673) for more information.
36+
37+
### C# 14 overload resolution with span parameters
38+
39+
NET Core will redirect `array.Contains` extension method to `MemoryExtensions.Contains`, This will cause `MongoDB.Driver` to be unable to translate `IQueryable<T>`, If you are using `array.Contains` in your code, you should use following code to avoid this problem.
40+
41+
> Only array has this problem, other types are not affected. eg List<T>, HashSet<T>, etc.
42+
43+
> MongoDB.Driver will be fixed in the future.
44+
45+
```csharp
46+
M((array, num) => array.Contains(num)); // fails, binds to MemoryExtensions.Contains
47+
M((array, num) => ((IEnumerable<int>)array).Contains(num)); // ok, binds to Enumerable.Contains
48+
M((array, num) => array.AsEnumerable().Contains(num)); // ok, binds to Enumerable.Contains
49+
M((array, num) => Enumerable.Contains(array, num)); // ok, binds to Enumerable.Contains
50+
```
51+
52+
See the [C# 14 overload resolution with span parameters](https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/10.0/csharp-overload-resolution#recommended-action) for more information.
53+
54+
### OpenIddict 7.X
55+
56+
We upgraded OpenIddict to 7.X. See the [OpenIddict 6.x to 7.x Migration Guide](https://documentation.openiddict.com/guides/migration/60-to-70.html) for more information.
57+
58+
OpenIddict 7.X changed the `OpenIddictToken` entity, you must create a new database migration if you use Entity Framework Core.
59+
60+
### Migrating from AutoMapper to Mapperly
61+
62+
The AutoMapper library is no longer free for commercial use. For more details, you can refer to this [announcement post](https://www.jimmybogard.com/automapper-and-mediatr-going-commercial/).
63+
64+
In this version, all ABP modules use Mapperly instead of AutoMapper. ABP Framework provides both AutoMapper and Mapperly integrations. If your project currently uses AutoMapper and you don't have a commercial license, you can follow the [Migrating from AutoMapper to Mapperly](https://github.com/abpframework/abp/blob/dev/docs/en/release-info/migration-guides/AutoMapper-To-Mapperly.md) document to migrate to Mapperly.
65+
66+
### Failure Retry Policy for InboxProcessor
67+
68+
We added a failure retry policy to `AbpEventBusBoxesOptions` (see `InboxProcessorFailurePolicy` and `InboxProcessorRetryBackoffFactor`). Because this change adds and removes fields in the `IncomingEventRecord` entity, you must create a new database migration if you use Inbox/Outbox with Entity Framework Core.
69+
70+
* `InboxProcessorFailurePolicy`: The policy to handle the failure of the inbox processor. Default value is `Retry`. Possible values are:
71+
* `Retry`: The current exception and subsequent events will continue to be processed in order in the next cycle.
72+
* `RetryLater`: Skip the event that caused the exception and continue with the following events. The failed event will be retried after a delay that doubles with each retry, starting from the configured `InboxProcessorRetryBackoffFactor` (e.g., 10, 20, 40, 80 seconds). The default maximum retry count is 10 (configurable). Discard the event if it still fails after reaching the maximum retry count.
73+
* `Discard`: The event that caused the exception will be discarded and will not be retried.
74+
* `InboxProcessorRetryBackoffFactor`: The initial retry delay factor (double) used when `InboxProcessorFailurePolicy` is `RetryLater`. The retry delay is calculated as: `delay = InboxProcessorRetryBackoffFactor × 2^retryCount`. Default value is `10`.
75+
76+
See the [Add failure retry policy to InboxProcessor](https://github.com/abpframework/abp/pull/23563) PR for more information.
77+
78+
### Disable Cache Error Hiding in Development Environment
79+
80+
Starting from **ABP 10.0**, the [`HideErrors`](../../framework/fundamentals/caching#Available-Options) option of `AbpDistributedCacheOptions` is **disabled by default in the development environment**.
81+
82+
By default, ABP hides and logs cache server errors to keep the application running even when the cache is unavailable.
83+
However, in the **development environment**, errors are no longer hidden so that developers can immediately detect and fix **any cache server issues** (such as connection, configuration, or runtime errors).
84+
85+
## PRO
86+

0 commit comments

Comments
 (0)