File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1554,9 +1554,14 @@ private byte[] CreateConnectionAttributes(string programName)
15541554 catch ( PlatformNotSupportedException )
15551555 {
15561556 }
1557+ #if NET45 || NET461 || NET471 || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_1 || NETCOREAPP3_1
15571558 using var process = Process . GetCurrentProcess ( ) ;
1559+ var processId = process . Id ;
1560+ #else
1561+ var processId = Environment . ProcessId ;
1562+ #endif
15581563 attributesWriter . WriteLengthEncodedString ( "_pid" ) ;
1559- attributesWriter . WriteLengthEncodedString ( process . Id . ToString ( CultureInfo . InvariantCulture ) ) ;
1564+ attributesWriter . WriteLengthEncodedString ( processId . ToString ( CultureInfo . InvariantCulture ) ) ;
15601565 if ( programName . Length != 0 )
15611566 {
15621567 attributesWriter . WriteLengthEncodedString ( "program_name" ) ;
You can’t perform that action at this time.
0 commit comments