-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add and use Environment.ProcessId #38908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,24 +10,6 @@ | |
| <Compile Include="System\Diagnostics\DelimitedListTraceListener.cs" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not need to have OS specific build anymore.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I tried that, but I got errors that I wasn't sure what to do with, and so decided to leave that for a follow-up, e.g.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the reference to System.Diagnostics.Process? Is its still used anywhere? IIRC there was a case for Process.GetCurrentProcess().ProcessName which was unused in some cases. Perhaps we can use a different pattern to obtain the name of the process, like AppDomain.CurrentDomain.FriendlyName 🤮 or add Environment.ProcessName.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ericstj, I can remove the Process reference, but then the error just becomes: for FileSystem.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks to me like you're talking about a different project? This comment is on TextWriterTraceListener and the error mentions In the case of TraceSource you might be able to get away with changing from a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was talking about TraceSource (the below "Same here" comment was applying to TraceSource as well, so I've just been using that as a guinea pig). For TextWriterTraceListener, it does still use Process, to get the current process name.
The purpose of this PR is to add Environment.ProcessId. I'm not going to hold it up right now fiddling with the csproj. Please open an issue about consolidating the target frameworks if there isn't already one tracking that. Thanks!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, that's fine by me. /cc @Anipik
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can follow up with this and see where we can leverage this api and remove cross targeting |
||
| <Compile Include="System\Diagnostics\TextWriterTraceListener.cs" /> | ||
| <Compile Include="System\Diagnostics\XmlWriterTraceListener.cs" /> | ||
| <Compile Include="$(CommonPath)System\Diagnostics\TraceListenerHelpers.cs" | ||
| Link="Common\System\Diagnostics\TraceListenerHelpers.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetsWindows)' == 'true'"> | ||
| <Compile Include="$(CommonPath)System\Diagnostics\TraceListenerHelpers.Windows.cs" | ||
| Link="Common\System\Diagnostics\TraceListenerHelpers.Windows.cs" /> | ||
| <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs" | ||
| Link="Common\Interop\Windows\Interop.Libraries.cs" /> | ||
| <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentProcessId.cs" | ||
| Link="Common\Interop\Windows\Interop.GetCurrentProcessId.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'"> | ||
| <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs" | ||
| Link="Common\Interop\Unix\Interop.Libraries.cs" /> | ||
| <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetPid.cs" | ||
| Link="Common\Interop\Unix\Interop.GetPid.cs" /> | ||
| <Compile Include="$(CommonPath)System\Diagnostics\TraceListenerHelpers.Unix.cs" | ||
| Link="Common\System\Diagnostics\TraceListenerHelpers.Unix.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Reference Include="System.ComponentModel.Primitives" /> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.