lulianqi opened a new pull request, #39: URL: https://github.com/apache/dubbo-net/pull/39
## Purpose and value Fixes #11. DubboNet currently exposes only a `net10.0` library asset. This couples adoption of an RPC client to upgrading the consuming application to .NET 10, even though most client functionality does not require that application model. This PR separates the **library's compatibility contract** from the **SDK and runtime used to develop it**. It adds `netstandard2.0` and `net8.0`, while retaining `net10.0` and the .NET 10 SDK. Existing applications can integrate with Java/Dubbo without an unrelated runtime migration, and modern applications retain their native implementations. Public invocation APIs remain unchanged. | Consumer | Selected library asset | Benefit / boundary | | --- | --- | --- | | .NET 10 | `net10.0` | Retains native modern APIs and the existing invocation model | | .NET 8 | `net8.0` | Direct support without requiring the .NET 10 runtime | | .NET 6 | `netstandard2.0` | Older-consumer compatibility verified with the full Provider-method E2E suite | | .NET Framework 4.8 | `netstandard2.0` | Enables package consumption; Native/Triple runtime smoke is configured on Windows, with registry restrictions documented | ## What changes ### Core compatibility, without a public API redesign - Multi-target the core library as `netstandard2.0;net8.0;net10.0`. Keep modern language syntax with the .NET 10 SDK; compiler compatibility markers remain internal. - Centralize API gaps under internal `Compatibility/` helpers, with explanatory comments at non-obvious call sites: task waiting, TCP/stream I/O, HTTP content reads and handler selection, monotonic timing, weighted random selection, collections, strings and numeric endpoint parsing. - Preserve cancellation/deadline semantics, shared connections, atomic removal of discovery tasks, decoding budgets and ordinal comparisons. A cancelled wait does not cancel a shared registry operation; an unpublished connection attempt can still be aborted. Late failures are observed. - Keep native APIs on modern targets. The Standard asset uses the modern HTTP handler when available; legacy limitations are explicit rather than changing global TLS/connection settings. - Declare directly used dependencies and audit the complete consumer graph. The Standard dependency group explicitly avoids the old `DependencyModel` path that selected vulnerable `Newtonsoft.Json 9.0.1` for Framework consumers. ### Verification of the shipped artifacts, not only a successful compilation - Add 36 compatibility cases while retaining all 556 original unit cases. Run the full suite on .NET 8/10 with both native and forced-Standard assets. - Assert the actual loaded library target before network tests, so a modern host cannot accidentally test its native DLL when Standard was requested. Isolate test outputs by selected library asset and reject partial-target packing. - Add a real NuGet consumer for .NET Framework 4.8 and .NET 6/8/10. It checks nearest-asset selection, dependency resolution, Native Hessian2 and Triple HTTP/JSON round trips, and a stalled-body deadline without using a project reference. - Prepare a complete private validation package under a unique identity. Project-local source mapping and caches support ordinary solution/IDE restore without changing global NuGet settings, substituting an older public package or reusing a stale validation DLL. - Keep license/NOTICE documents in the multi-target package and keep artifact caches out of compilation and Docker contexts. ### End-to-end CI and documentation - Run all 156 Provider-method/metadata cases sequentially on **.NET 10 → .NET 6 → .NET 8**. .NET 6 automatically selects Standard; the core library does not gain a separate `net6.0` target. - Retain forced-Standard E2E checks on .NET 10/8, existing registry/direct-protocol integration checks and examples. Also execute the actual prepared Standard NuGet consumer on .NET 6. - Keep hosts sequential because the Java fixtures have stateful methods. Restrict runtime roll-forward to patches and save separate log/TRX files per run. - Preserve existing workflow triggers, required job names, temporary registries/Java Providers, bounded readiness and unconditional cleanup. Do not hardcode external registry addresses. - Update both READMEs, the environment guide and `Docs/FrameworkCompatibility.md` with selection rules, validation commands, implementation tradeoffs and support boundaries. ## Validation Local validation used macOS arm64 and SDK 10.0.201. Remote registry addresses were supplied only at runtime; CI continues to use its isolated local fixtures. | Check | Result | | --- | --- | | Solution restore and Release build | Passed, no build errors | | Full unit suite: .NET 8/native, .NET 10/native, .NET 8/Standard, .NET 10/Standard | **592 passed in each combination; 0 failed/skipped** | | Full Provider-method E2E: .NET 10/native, .NET 6/Standard, .NET 8/native, .NET 10/Standard, .NET 8/Standard | **156 passed in each combination; 0 failed/skipped** | | Actual NuGet consumer: .NET 6/8/10 | Asset selection, Native/Triple round trips and body deadline passed | | Standard registry integration executable | ZooKeeper **54/54**, Nacos **32/32** | | QueryDemo with Standard and net10 assets | **12/12 per registry and asset** | | Additional consumer-registration smoke | Shared leases, enable/disable/re-enable and final deregistration verified with both registries | | Public API comparison against `main` | All three assets retain **61 exported types / 1041 public/protected declarations**, with no differences | | Complete real-consumer dependency advisory scan, including Framework | No reported vulnerable packages at validation time | | .NET Framework 4.8 package consumer | Cross-compilation passed; Windows execution awaits CI | | Workflow/configuration checks | YAML/XML parsing, Bash syntax, runtime order, trigger consistency and whitespace checks passed | The .NET 6 testhost was confirmed to run on **6.0.36**, with the Standard library loaded; the modern hosts were **10.0.5** and **8.0.15**. This is runtime execution, not merely cross-compilation. ## Compatibility boundaries and review notes - Compatibility does not extend a runtime vendor's support lifecycle. .NET 6 is an older-consumer regression check, not a recommendation for new deployments; EOL warnings are not suppressed. - A Standard DLL does not make Nacos 2 HTTP/2/gRPC streaming work on every .NET Framework/Windows combination. Full Framework registry support is **not** claimed. Legacy per-handler idle-eviction limitations are documented. - Mono/Unity/mobile, trimming and NativeAOT are not certified by this change. .NET 7/9 have compatible asset-selection paths but are not independently runtime-tested here. - This machine has no Docker or Windows runtime. The complete temporary-container workflow and Windows execution must pass their actual GitHub CI runs; local success is not presented as CI approval. - This PR does not publish a NuGet package or create a release. ### Reproducing the local package checks On a fresh checkout, prepare the private validation package **before** restoring the solution: ```bash dotnet msbuild Tests/PackageCompatibilitySmoke/Prepare.proj dotnet restore DubboNet.sln dotnet build DubboNet.sln -c Release --no-restore -p:GeneratePackageOnBuild=false ``` Repeat preparation after library edits when verifying a newly built package. Further unit/E2E commands and platform limitations are documented in `Docs/FrameworkCompatibility.md`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
