Migrate to .NET 6

Proprietary

Migrate C# projects to .NET 6, applying necessary API changes for obsoleted cryptographic types and other breaking changes. Includes all .NET Core 3.0, 3.1, and .NET 5 migration steps. See https://learn.microsoft.com/en-us/dotnet/core/compatibility/6.0.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UpgradeToDotNet6
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UpgradeToDotNet6

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate to .NET 5
  2. Change .NET target framework
  3. Upgrade NuGet package version
  4. Upgrade NuGet package version
  5. Upgrade NuGet package version
  6. Upgrade NuGet package version
  7. Upgrade NuGet package version
  8. Ensure csproj attestation
  9. Replace internal FormattedLogValues with a type alias
  10. Cast RedisValue to string for JsonSerializer.Deserialize
  11. Change type
  12. Change type
  13. Change type
  14. Change type
  15. Change type
  16. Change type
  17. Change type
  18. Change type
  19. Change type
  20. Change type
  21. Change type
  22. Change type
  23. Change type
  24. Change type
  25. Change type
  26. Change type
  27. Change type
  28. Use factory method for abstract cryptographic types
  29. Change method name
  30. Delete method argument
  31. Find WebRequest/HttpWebRequest/WebClient usage (SYSLIB0014)
  32. Find Thread.Abort usage (SYSLIB0006)
  33. Find JsonSerializerOptions.IgnoreNullValues usage (SYSLIB0020)
  34. Find X509Certificate2.PrivateKey usage (SYSLIB0028)
  35. Find Assembly.CodeBase/EscapedCodeBase usage (SYSLIB0012)
  36. Use Environment.ProcessId
  37. Use Environment.CurrentManagedThreadId
  38. Use Environment.ProcessPath
  39. Use LINQ MaxBy() and MinBy()
  40. Use LINQ DistinctBy()
  41. Use Random.Shared
  42. Use ArgumentNullException.ThrowIfNull()
  43. Use string.Contains(char) overload
  44. Use string.StartsWith(char)/EndsWith(char) overload