Breaking changes in .NET Core 2.1
Article 03/18/2023
3 contributors
Feedback
In this article
Core .NET libraries
MSBuild
See also
If you're migrating to version 2.1 of .NET Core, the breaking changes listed in this article may affect your app.
Path APIs don't throw an exception for invalid characters
APIs that involve file paths no longer validate path characters or throw an ArgumentException if an invalid character is found.
In .NET Framework and .NET Core 1.0 - 2.0, the methods listed in the Affected APIs section throw an ArgumentException if the path argument contains an invalid path character. Starting in .NET Core 2.1, these methods no longer check for invalid path characters or throw an exception if an invalid character is found.
Aggressive validation of path characters blocks some cross-platform scenarios. This change was introduced so that .NET does not try to replicate or predict the outcome of operating system API calls. For more information, see the System.IO in .NET Core 2.1 sneak peek blog post.
.NET Core 2.1
If your code relied on these APIs to check for invalid characters, you can add a call to Path.GetInvalidPathChars .
System.IO.Directory.CreateDirectory
System.IO.Directory.Delete
System.IO.Directory.EnumerateDirectories
System.IO.Directory.EnumerateFiles
System.IO.Directory.EnumerateFileSystemEntries
System.IO.Directory.GetCreationTime(String)
System.IO.Directory.GetCreationTimeUtc(String)
System.IO.Directory.GetDirectories
System.IO.Directory.GetDirectoryRoot(String)
System.IO.Directory.GetFiles
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetLastAccessTime(String)
System.IO.Directory.GetLastAccessTimeUtc(String)
System.IO.Directory.GetLastWriteTime(String)
System.IO.Directory.GetLastWriteTimeUtc(String)
System.IO.Directory.GetParent(String)
System.IO.Directory.Move(String, String)
System.IO.Directory.SetCreationTime(String, DateTime)
System.IO.Directory.SetCreationTimeUtc(String, DateTime)
System.IO.Directory.SetCurrentDirectory(String)
System.IO.Directory.SetLastAccessTime(String, DateTime)
System.IO.Directory.SetLastAccessTimeUtc(String, DateTime)
System.IO.Directory.SetLastWriteTime(String, DateTime)
System.IO.Directory.SetLastWriteTimeUtc(String, DateTime)
System.IO.DirectoryInfo ctor
System.IO.Directory.GetDirectories
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.File.AppendAllText
System.IO.File.AppendAllTextAsync
System.IO.File.Copy
System.IO.File.Create
System.IO.File.CreateText
System.IO.File.Decrypt
System.IO.File.Delete
System.IO.File.Encrypt
System.IO.File.GetAttributes(String)
System.IO.File.GetCreationTime(String)
System.IO.File.GetCreationTimeUtc(String)
System.IO.File.GetLastAccessTime(String)
System.IO.File.GetLastAccessTimeUtc(String)
System.IO.File.GetLastWriteTime(String)
System.IO.File.GetLastWriteTimeUtc(String)
System.IO.File.Move
System.IO.File.Open
System.IO.File.OpenRead(String)
System.IO.File.OpenText(String)
System.IO.File.OpenWrite(String)
System.IO.File.ReadAllBytes(String)
System.IO.File.ReadAllBytesAsync(String, CancellationToken)
System.IO.File.ReadAllLines(String)
System.IO.File.ReadAllLinesAsync(String, CancellationToken)
System.IO.File.ReadAllText(String)
System.IO.File.ReadAllTextAsync(String, CancellationToken)
System.IO.File.SetAttributes(String, FileAttributes)
System.IO.File.SetCreationTime(String, DateTime)
System.IO.File.SetCreationTimeUtc(String, DateTime)
System.IO.File.SetLastAccessTime(String, DateTime)
System.IO.File.SetLastAccessTimeUtc(String, DateTime)
System.IO.File.SetLastWriteTime(String, DateTime)
System.IO.File.SetLastWriteTimeUtc(String, DateTime)
System.IO.File.WriteAllBytes(String, Byte[])
System.IO.File.WriteAllBytesAsync(String, Byte[], CancellationToken)
System.IO.File.WriteAllLines
System.IO.File.WriteAllLinesAsync
System.IO.File.WriteAllText
System.IO.FileInfo ctor
System.IO.FileInfo.CopyTo
System.IO.FileInfo.MoveTo
System.IO.FileStream ctor
System.IO.Path.GetFullPath(String)
System.IO.Path.IsPathRooted(String)
System.IO.Path.GetPathRoot(String)
System.IO.Path.ChangeExtension(String, String)
System.IO.Path.GetDirectoryName(String)
System.IO.Path.GetExtension(String)
System.IO.Path.HasExtension(String)
System.IO.Path.Combine
Private fields added to built-in struct types
Private fields were added to certain struct types in reference assemblies . As a result, in C#, those struct types must always be instantiated by using the new operator or default literal .
In .NET Core 2.0 and previous versions, some provided struct types, for example, ConsoleKeyInfo , could be instantiated without using the new
operator or default literal in C#. This was because the reference assemblies used by the C# compiler didn't contain the private fields for the structs. All private fields for .NET struct types are added to the reference assemblies starting in .NET Core 2.1.
For example, the following C# code compiles in .NET Core 2.0, but not in .NET Core 2.1:
ConsoleKeyInfo key;
if (key.ToString() == "y" )
{
Console.WriteLine("Yes!" );
}
In .NET Core 2.1, the previous code results in the following compiler error: CS0165 - Use of unassigned local variable 'key'
2.1
Instantiate struct types by using the new
operator or default literal .
For example:
ConsoleKeyInfo key = new ConsoleKeyInfo();
if (key.ToString() == "y" )
Console.WriteLine("Yes!" );
ConsoleKeyInfo key = default ;
if (key.ToString() == "y" )
Console.WriteLine("Yes!" );
Core .NET libraries
System.ArraySegment<T>.Enumerator
System.ArraySegment<T>
System.Boolean
System.Buffers.MemoryHandle
System.Buffers.StandardFormat
System.Byte
System.Char
System.Collections.DictionaryEntry
System.Collections.Generic.Dictionary<TKey,TValue>.Enumerator
System.Collections.Generic.Dictionary<TKey,TValue>.KeyCollection.Enumerator
System.Collections.Generic.Dictionary<TKey,TValue>.ValueCollection.Enumerator
System.Collections.Generic.HashSet<T>.Enumerator
System.Collections.Generic.KeyValuePair<TKey,TValue>
System.Collections.Generic.LinkedList<T>.Enumerator
System.Collections.Generic.List<T>.Enumerator
System.Collections.Generic.Queue<T>.Enumerator
System.Collections.Generic.SortedDictionary<TKey,TValue>.Enumerator
System.Collections.Generic.SortedDictionary<TKey,TValue>.KeyCollection.Enumerator
System.Collections.Generic.SortedDictionary<TKey,TValue>.ValueCollection.Enumerator
System.Collections.Generic.SortedSet<T>.Enumerator
System.Collections.Generic.Stack<T>.Enumerator
System.Collections.Immutable.ImmutableArray<T>.Enumerator
System.Collections.Immutable.ImmutableArray<T>
System.Collections.Immutable.ImmutableDictionary<TKey,TValue>.Enumerator
System.Collections.Immutable.ImmutableHashSet<T>.Enumerator
System.Collections.Immutable.ImmutableList<T>.Enumerator
System.Collections.Immutable.ImmutableQueue<T>.Enumerator
System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>.Enumerator
System.Collections.Immutable.ImmutableSortedSet<T>.Enumerator
System.Collections.Immutable.ImmutableStack<T>.Enumerator
System.Collections.Specialized.BitVector32.Section
System.Collections.Specialized.BitVector32
LazyMemberInfo
System.ComponentModel.Design.Serialization.MemberRelationship
System.ConsoleKeyInfo
System.Data.SqlTypes.SqlBinary
System.Data.SqlTypes.SqlBoolean
System.Data.SqlTypes.SqlByte
System.Data.SqlTypes.SqlDateTime
System.Data.SqlTypes.SqlDecimal
System.Data.SqlTypes.SqlDouble
System.Data.SqlTypes.SqlGuid
System.Data.SqlTypes.SqlInt16
System.Data.SqlTypes.SqlInt32
System.Data.SqlTypes.SqlInt64
System.Data.SqlTypes.SqlMoney
System.Data.SqlTypes.SqlSingle
System.Data.SqlTypes.SqlString
System.DateTime
System.DateTimeOffset
System.Decimal
System.Diagnostics.CounterSample
System.Diagnostics.SymbolStore.SymbolToken
System.Diagnostics.Tracing.EventSource.EventData
System.Diagnostics.Tracing.EventSourceOptions
System.Double
System.Drawing.CharacterRange
System.Drawing.Point
System.Drawing.PointF
System.Drawing.Rectangle
System.Drawing.RectangleF
System.Drawing.Size
System.Drawing.SizeF
System.Guid
System.HashCode
System.Int16
System.Int32
System.Int64
System.IntPtr
System.IO.Pipelines.FlushResult
System.IO.Pipelines.ReadResult
System.IO.WaitForChangedResult
System.Memory<T>
System.ModuleHandle
System.Net.Security.SslApplicationProtocol
System.Net.Sockets.IPPacketInformation
System.Net.Sockets.SocketInformation
System.Net.Sockets.UdpReceiveResult
System.Net.WebSockets.ValueWebSocketReceiveResult
System.Nullable<T>
System.Numerics.BigInteger
System.Numerics.Complex
System.Numerics.Vector<T>
System.ReadOnlyMemory<T>
System.ReadOnlySpan<T>.Enumerator
System.ReadOnlySpan<T>
System.Reflection.CustomAttributeNamedArgument
System.Reflection.CustomAttributeTypedArgument
System.Reflection.Emit.Label
System.Reflection.Emit.OpCode
System.Reflection.Metadata.ArrayShape
System.Reflection.Metadata.AssemblyDefinition
System.Reflection.Metadata.AssemblyDefinitionHandle
System.Reflection.Metadata.AssemblyFile
System.Reflection.Metadata.AssemblyFileHandle
System.Reflection.Metadata.AssemblyFileHandleCollection.Enumerator
System.Reflection.Metadata.AssemblyFileHandleCollection
System.Reflection.Metadata.AssemblyReference
System.Reflection.Metadata.AssemblyReferenceHandle
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator
System.Reflection.Metadata.AssemblyReferenceHandleCollection
System.Reflection.Metadata.Blob
System.Reflection.Metadata.BlobBuilder.Blobs
System.Reflection.Metadata.BlobContentId
System.Reflection.Metadata.BlobHandle
System.Reflection.Metadata.BlobReader
System.Reflection.Metadata.BlobWriter
System.Reflection.Metadata.Constant
System.Reflection.Metadata.ConstantHandle
System.Reflection.Metadata.CustomAttribute
System.Reflection.Metadata.CustomAttributeHandle
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator
System.Reflection.Metadata.CustomAttributeHandleCollection
System.Reflection.Metadata.CustomAttributeNamedArgument<TType>
System.Reflection.Metadata.CustomAttributeTypedArgument<TType>
System.Reflection.Metadata.CustomAttributeValue<TType>
System.Reflection.Metadata.CustomDebugInformation
System.Reflection.Metadata.CustomDebugInformationHandle
System.Reflection.Metadata.CustomDebugInformationHandleCollection.Enumerator
System.Reflection.Metadata.CustomDebugInformationHandleCollection
System.Reflection.Metadata.DeclarativeSecurityAttribute
System.Reflection.Metadata.DeclarativeSecurityAttributeHandle
System.Reflection.Metadata.DeclarativeSecurityAttributeHandleCollection.Enumerator
System.Reflection.Metadata.DeclarativeSecurityAttributeHandleCollection
System.Reflection.Metadata.Document
System.Reflection.Metadata.DocumentHandle
System.Reflection.Metadata.DocumentHandleCollection.Enumerator
System.Reflection.Metadata.DocumentHandleCollection
System.Reflection.Metadata.DocumentNameBlobHandle
System.Reflection.Metadata.Ecma335.ArrayShapeEncoder
System.Reflection.Metadata.Ecma335.BlobEncoder
System.Reflection.Metadata.Ecma335.CustomAttributeArrayTypeEncoder
System.Reflection.Metadata.Ecma335.CustomAttributeElementTypeEncoder
System.Reflection.Metadata.Ecma335.CustomAttributeNamedArgumentsEncoder
System.Reflection.Metadata.Ecma335.CustomModifiersEncoder
System.Reflection.Metadata.Ecma335.EditAndContinueLogEntry
System.Reflection.Metadata.Ecma335.ExceptionRegionEncoder
System.Reflection.Metadata.Ecma335.FixedArgumentsEncoder
System.Reflection.Metadata.Ecma335.GenericTypeArgumentsEncoder
System.Reflection.Metadata.Ecma335.InstructionEncoder
System.Reflection.Metadata.Ecma335.LabelHandle
System.Reflection.Metadata.Ecma335.LiteralEncoder
System.Reflection.Metadata.Ecma335.LiteralsEncoder
System.Reflection.Metadata.Ecma335.LocalVariablesEncoder
System.Reflection.Metadata.Ecma335.LocalVariableTypeEncoder
System.Reflection.Metadata.Ecma335.MethodBodyStreamEncoder.MethodBody
System.Reflection.Metadata.Ecma335.MethodBodyStreamEncoder
System.Reflection.Metadata.Ecma335.MethodSignatureEncoder
System.Reflection.Metadata.Ecma335.NamedArgumentsEncoder
System.Reflection.Metadata.Ecma335.NamedArgumentTypeEncoder
System.Reflection.Metadata.Ecma335.NameEncoder
System.Reflection.Metadata.Ecma335.ParametersEncoder
System.Reflection.Metadata.Ecma335.ParameterTypeEncoder
System.Reflection.Metadata.Ecma335.PermissionSetEncoder
System.Reflection.Metadata.Ecma335.ReturnTypeEncoder
System.Reflection.Metadata.Ecma335.ScalarEncoder
System.Reflection.Metadata.Ecma335.SignatureDecoder<TType,TGenericContext>
System.Reflection.Metadata.Ecma335.SignatureTypeEncoder
System.Reflection.Metadata.Ecma335.VectorEncoder
System.Reflection.Metadata.EntityHandle
System.Reflection.Metadata.EventAccessors
System.Reflection.Metadata.EventDefinition
System.Reflection.Metadata.EventDefinitionHandle
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator
System.Reflection.Metadata.EventDefinitionHandleCollection
System.Reflection.Metadata.ExceptionRegion
System.Reflection.Metadata.ExportedType
System.Reflection.Metadata.ExportedTypeHandle
System.Reflection.Metadata.ExportedTypeHandleCollection.Enumerator
System.Reflection.Metadata.ExportedTypeHandleCollection
System.Reflection.Metadata.FieldDefinition
System.Reflection.Metadata.FieldDefinitionHandle
System.Reflection.Metadata.FieldDefinitionHandleCollection.Enumerator
System.Reflection.Metadata.FieldDefinitionHandleCollection
System.Reflection.Metadata.GenericParameter
System.Reflection.Metadata.GenericParameterConstraint
System.Reflection.Metadata.GenericParameterConstraintHandle
System.Reflection.Metadata.GenericParameterConstraintHandleCollection.Enumerator
System.Reflection.Metadata.GenericParameterConstraintHandleCollection
System.Reflection.Metadata.GenericParameterHandle
System.Reflection.Metadata.GenericParameterHandleCollection.Enumerator
System.Reflection.Metadata.GenericParameterHandleCollection
System.Reflection.Metadata.GuidHandle
System.Reflection.Metadata.Handle
System.Reflection.Metadata.ImportDefinition
System.Reflection.Metadata.ImportDefinitionCollection.Enumerator
System.Reflection.Metadata.ImportDefinitionCollection
System.Reflection.Metadata.ImportScope
System.Reflection.Metadata.ImportScopeCollection.Enumerator
System.Reflection.Metadata.ImportScopeCollection
System.Reflection.Metadata.ImportScopeHandle
System.Reflection.Metadata.InterfaceImplementation
System.Reflection.Metadata.InterfaceImplementationHandle
System.Reflection.Metadata.InterfaceImplementationHandleCollection.Enumerator
System.Reflection.Metadata.InterfaceImplementationHandleCollection
System.Reflection.Metadata.LocalConstant
System.Reflection.Metadata.LocalConstantHandle
System.Reflection.Metadata.LocalConstantHandleCollection.Enumerator
System.Reflection.Metadata.LocalConstantHandleCollection
System.Reflection.Metadata.LocalScope
System.Reflection.Metadata.LocalScopeHandle
System.Reflection.Metadata.LocalScopeHandleCollection.ChildrenEnumerator
System.Reflection.Metadata.LocalScopeHandleCollection.Enumerator
System.Reflection.Metadata.LocalScopeHandleCollection
System.Reflection.Metadata.LocalVariable
System.Reflection.Metadata.LocalVariableHandle
System.Reflection.Metadata.LocalVariableHandleCollection.Enumerator
System.Reflection.Metadata.LocalVariableHandleCollection
System.Reflection.Metadata.ManifestResource
System.Reflection.Metadata.ManifestResourceHandle
System.Reflection.Metadata.ManifestResourceHandleCollection.Enumerator
System.Reflection.Metadata.ManifestResourceHandleCollection
System.Reflection.Metadata.MemberReference
System.Reflection.Metadata.MemberReferenceHandle
System.Reflection.Metadata.MemberReferenceHandleCollection.Enumerator
System.Reflection.Metadata.MemberReferenceHandleCollection
System.Reflection.Metadata.MetadataStringComparer
System.Reflection.Metadata.MethodDebugInformation
System.Reflection.Metadata.MethodDebugInformationHandle
System.Reflection.Metadata.MethodDebugInformationHandleCollection.Enumerator
System.Reflection.Metadata.MethodDebugInformationHandleCollection
System.Reflection.Metadata.MethodDefinition
System.Reflection.Metadata.MethodDefinitionHandle
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator
System.Reflection.Metadata.MethodDefinitionHandleCollection
System.Reflection.Metadata.MethodImplementation
System.Reflection.Metadata.MethodImplementationHandle
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator
System.Reflection.Metadata.MethodImplementationHandleCollection
System.Reflection.Metadata.MethodImport
System.Reflection.Metadata.MethodSignature<TType>
System.Reflection.Metadata.MethodSpecification
System.Reflection.Metadata.MethodSpecificationHandle
System.Reflection.Metadata.ModuleDefinition
System.Reflection.Metadata.ModuleDefinitionHandle
System.Reflection.Metadata.ModuleReference
System.Reflection.Metadata.ModuleReferenceHandle
System.Reflection.Metadata.NamespaceDefinition
System.Reflection.Metadata.NamespaceDefinitionHandle
System.Reflection.Metadata.Parameter
System.Reflection.Metadata.ParameterHandle
System.Reflection.Metadata.ParameterHandleCollection.Enumerator
System.Reflection.Metadata.ParameterHandleCollection
System.Reflection.Metadata.PropertyAccessors
System.Reflection.Metadata.PropertyDefinition
System.Reflection.Metadata.PropertyDefinitionHandle
System.Reflection.Metadata.PropertyDefinitionHandleCollection.Enumerator
System.Reflection.Metadata.PropertyDefinitionHandleCollection
System.Reflection.Metadata.ReservedBlob<THandle>
System.Reflection.Metadata.SequencePoint
System.Reflection.Metadata.SequencePointCollection.Enumerator
System.Reflection.Metadata.SequencePointCollection
System.Reflection.Metadata.SignatureHeader
System.Reflection.Metadata.StandaloneSignature
System.Reflection.Metadata.StandaloneSignatureHandle
System.Reflection.Metadata.StringHandle
System.Reflection.Metadata.TypeDefinition
System.Reflection.Metadata.TypeDefinitionHandle
System.Reflection.Metadata.TypeDefinitionHandleCollection.Enumerator
System.Reflection.Metadata.TypeDefinitionHandleCollection
System.Reflection.Metadata.TypeLayout
System.Reflection.Metadata.TypeReference
System.Reflection.Metadata.TypeReferenceHandle
System.Reflection.Metadata.TypeReferenceHandleCollection.Enumerator
System.Reflection.Metadata.TypeReferenceHandleCollection
System.Reflection.Metadata.TypeSpecification
System.Reflection.Metadata.TypeSpecificationHandle
System.Reflection.Metadata.UserStringHandle
System.Reflection.ParameterModifier
System.Reflection.PortableExecutable.CodeViewDebugDirectoryData
System.Reflection.PortableExecutable.DebugDirectoryEntry
System.Reflection.PortableExecutable.PEMemoryBlock
System.Reflection.PortableExecutable.SectionHeader
System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>
System.Runtime.CompilerServices.AsyncTaskMethodBuilder
System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<TResult>
System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder
System.Runtime.CompilerServices.AsyncVoidMethodBuilder
System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter
System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>
System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter
System.Runtime.CompilerServices.ConfiguredTaskAwaitable
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>.ConfiguredValueTaskAwaiter
System.Runtime.CompilerServices.TaskAwaiter<TResult>
System.Runtime.CompilerServices.TaskAwaiter
System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>
System.Runtime.CompilerServices.ValueTaskAwaiter<TResult>
System.Runtime.InteropServices.ArrayWithOffset
System.Runtime.InteropServices.GCHandle
System.Runtime.InteropServices.HandleRef
System.Runtime.InteropServices.OSPlatform
System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken
System.Runtime.Serialization.SerializationEntry
System.Runtime.Serialization.StreamingContext
System.RuntimeArgumentHandle
System.RuntimeFieldHandle
System.RuntimeMethodHandle
System.RuntimeTypeHandle
System.SByte
System.Security.Cryptography.CngProperty
System.Security.Cryptography.ECCurve
System.Security.Cryptography.HashAlgorithmName
System.Security.Cryptography.X509Certificates.X509ChainStatus
System.Security.Cryptography.Xml.X509IssuerSerial
System.ServiceProcess.SessionChangeDescription
System.Single
System.Span<T>.Enumerator
System.Span<T>
System.Threading.AsyncFlowControl
System.Threading.AsyncLocalValueChangedArgs<T>
System.Threading.CancellationToken
System.Threading.CancellationTokenRegistration
System.Threading.LockCookie
System.Threading.SpinLock
System.Threading.SpinWait
System.Threading.Tasks.Dataflow.DataflowMessageHeader
System.Threading.Tasks.ParallelLoopResult
System.Threading.Tasks.ValueTask<TResult>
System.TimeSpan
System.TimeZoneInfo.TransitionTime
System.Transactions.TransactionOptions
System.TypedReference
System.TypedReference
System.UInt16
System.UInt32
System.UInt64
System.UIntPtr
System.Windows.Forms.ColorDialog.Color
System.Windows.Media.Animation.KeyTime
System.Windows.Media.Animation.RepeatBehavior
System.Xml.Serialization.XmlDeserializationEvents
Windows.Foundation.Point
Windows.Foundation.Rect
Windows.Foundation.Size
Windows.UI.Color
Windows.UI.Xaml.Controls.Primitives.GeneratorPosition
Windows.UI.Xaml.CornerRadius
Windows.UI.Xaml.Duration
Windows.UI.Xaml.GridLength
Windows.UI.Xaml.Media.Matrix
Windows.UI.Xaml.Media.Media3D.Matrix3D
Windows.UI.Xaml.Thickness
OpenSSL versions on macOS
The .NET Core 3.0 and later runtimes on macOS now prefer OpenSSL 1.1.x versions to OpenSSL 1.0.x versions for the AesCcm , AesGcm , DSAOpenSsl , ECDiffieHellmanOpenSsl , ECDsaOpenSsl , RSAOpenSsl , and SafeEvpPKeyHandle types.
The .NET Core 2.1 runtime now supports OpenSSL 1.1.x versions, but still prefers OpenSSL 1.0.x versions.
Previously, the .NET Core runtime used OpenSSL 1.0.x versions on macOS for types that interact with OpenSSL. The most recent OpenSSL 1.0.x version, OpenSSL 1.0.2, is now out of support. To keep types that use OpenSSL on supported versions of OpenSSL, the .NET Core 3.0 and later runtimes now use newer versions of OpenSSL on macOS.
With this change, the behavior for the .NET Core runtimes on macOS is as follows:
The .NET Core 3.0 and later version runtimes use OpenSSL 1.1.x, if available, and fall back to OpenSSL 1.0.x only if there's no 1.1.x version available.
For callers that use the OpenSSL interop types with custom P/Invokes, follow the guidance in the SafeEvpPKeyHandle.OpenSslVersion remarks. Your app may crash if you don't check the OpenSslVersion value.
The .NET Core 2.1 runtime uses OpenSSL 1.0.x, if available, and falls back to OpenSSL 1.1.x if there's no 1.0.x version available.
The 2.1 runtime prefers the earlier version of OpenSSL because the SafeEvpPKeyHandle.OpenSslVersion property does not exist in .NET Core 2.1, so the OpenSSL version cannot be reliably determined at run time.
.NET Core 2.1.16
.NET Core 3.0.3
.NET Core 3.1.2
Core .NET libraries
The .NET Core 2.1 SDK now includes common CLI tooling, and you no longer need to reference these tools from the project.
In .NET Core 2.0, projects reference external .NET tools with the <DotNetCliToolReference>
project setting. In .NET Core 2.1, some of these tools are included with the .NET Core SDK, and the setting is no longer needed. If you include references to these tools in your project, you'll receive an error similar to the following: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK.
Tools now included in .NET Core 2.1 SDK:
Expand table
<DotNetCliToolReference> value
Tool
Microsoft.DotNet.Watcher.Tools
dotnet-watch
Microsoft.Extensions.SecretManager.Tools
dotnet-user-secrets
Microsoft.Extensions.Caching.SqlConfig.Tools
dotnet-sql-cache
Microsoft.EntityFrameworkCore.Tools.DotNet
dotnet-ef
.NET Core SDK 2.1.300
Remove the <DotNetCliToolReference>
setting from your project.
MSBuild
N/A