Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Port System.Diagnostics.EventLog to .NET Core #24344

Merged
merged 33 commits into from Oct 6, 2017
Merged

Port System.Diagnostics.EventLog to .NET Core #24344

merged 33 commits into from Oct 6, 2017

Conversation

Anipik
Copy link

@Anipik Anipik commented Sep 29, 2017

Adding Eventlog to .Net Core

@dnfclas
Copy link

dnfclas commented Sep 29, 2017

@Anipik,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla2.dotnetfoundation.org.

It will cover your contributions to all .NET Foundation-managed open source projects.
Thanks,
.NET Foundation Pull Request Bot

@danmoseley
Copy link
Member

Note for code reviewers: there are no tests for this yet. This gets it in the build. So we do not want to do any refactoring at this stage.

@danmoseley danmoseley changed the title WIP_EventLog Port System.EventLog to .NET Core Sep 29, 2017
# Visual Studio 15
VisualStudioVersion = 15.0.26919.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.EventLog", "..\src\System.EventLog.csproj", "{432779B9-3CBD-4871-A7DC-D8A192319DBD}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add the ref project also

using System.Runtime.InteropServices;
using System.Text;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I suggest doing with this file is: leave it unchanged. Make a new file next to it named Interop.FormatMessage_SafeLibraryHandle.cs. Into that put what you have here, ie., the FormatMessage that takes SafeLibraryHandle.
This will mean you can revert all the changes to the other C# projects that add SafeLibraryHandle and FreeLibrary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is more refactoring needed (copy the helper GetMessage code into there from EventLog code, and eliminate GetMessage(IntPtr moduleHandle changing its only existing caller to use the SafeLibraryHandle one) but that can happen later. My suggestion above will make it simpler for now.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace these two lines to match the Configurations.props, ie.,

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anipik a tip, you can use the thumbs up (click the smiley button) to acknowledge feedback without sending a mail each time to everyone subscribed to the issue or repo :)

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this

  <PropertyGroup>
    <IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx'">true</IsPartialFacadeAssembly>
  </PropertyGroup>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

<data name="TooManyReplacementStrings" xml:space="preserve">
<value>The maximum allowed number of replacement strings is 255.</value>
</data>
<data name="Win2000Required" xml:space="preserve">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Win2000Required and WinNTRequired strings. Remove the CheckEnvironment and CheckNtenvironment functions where they were used. Remove all calls to those functions.

Basically this was about checking whether it was running on Windows 95/98 or Windows 2000 etc. We are years past caring about that. We only run on Windows 7+. We don't check for that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageConfigurations>
netcoreapp;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change netcoreapp to netcoreapp-Windows_NT because this code is all Windows specific.
Unix will get the netstandard one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace these two lines with 6 lines for the src/Configurations.props, ie., one for netcoreapp-Windows_NT-Debug|AnyCPU, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced

public const int BACKWARDS_READ = 0x8;
public const int ERROR_EVENTLOG_FILE_CHANGED = 1503;
public const int ERROR_FILE_NOT_FOUND = 2;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit : extra lines.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

{
internal SafeEventLogReadHandle() : base(true) { }

#pragma warning disable BCL0015�// Disable Pinvoke analyzer errors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of BCL0015, please create a baseline file src\System.EventLog\src\PinvokeAnalyzerExceptionList.analyzerdata.netcoreapp
and in it put these one per line like

advapi32.dll!OpenEventLog
advapi32.dll!CloseEventLog

Here's an example:
https://github.com/dotnet/corefx/blob/master/src/System.Console/src/PinvokeAnalyzerExceptionList.analyzerdata.netcoreapp

I know I said I didn't care much about it, but today I'm dealing with the fallout of missing one of these in a different context, so I would like to be more rigorous about using baseline files instead (those are harder to overlook)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completed

}
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, extra lines

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced using regex in all files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private static extern bool CloseEventLog(IntPtr hEventLog);
#pragma warning restore BCL0015

override protected bool ReleaseHandle()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, should be protected override not override protected. see

https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md bullet 5

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search elsewhere for other cases of override protected please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced everywhere

return newException;
}

internal static int CurrentEnvironment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above please eliminate this whole property and fix its callers as if it was always returning W2kEnvironment (this is the newest for them)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

internal static Win32Exception CreateSafeWin32Exception(int error)
{
Win32Exception newException = null;
SecurityPermission securityPermission = new SecurityPermission(PermissionState.Unrestricted);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove securitypermission entirely. the try/finally below will be removable then also

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected

internal static class SharedUtils
{

internal const int UnknownEnvironment = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all 5 of these ints because you're getting rid of the checks and just assuming W2kEnvironment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

{
internal static class SharedUtils
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, extra line. You can use regexes to find this kind of thing if you like

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohky

private static bool SafeWaitForMutexOnce(Mutex mutexIn, ref Mutex mutexOut)
{
bool ret;
RuntimeHelpers.PrepareConstrainedRegions();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all use of RuntimeHelpers.PrepareConstrainedRegions(); and Thread.Begin/EndCriticalRegion();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

string dllDir = "";
RegistryKey baseKey = null;
RegistryKey complusReg = null;
RegistryPermission registryPermission = new RegistryPermission(PermissionState.Unrestricted);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove RegistryPermission entirely from the code please, and all calls on it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

public static extern bool ReportEvent(SafeHandle hEventLog, short type, ushort category,
uint eventID, byte[] userSID, short numStrings, int dataLen, HandleRef strings,
byte[] rawData);
#pragma warning disable BCL0015 // Disable Pinvoke analyzer errors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, please remove BCL0015 and use a baseline file instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed

#pragma warning disable BCL0015 // Disable Pinvoke analyzer errors.
[DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
public static extern bool ClearEventLog(SafeHandle hEventLog, HandleRef lpctstrBackupFileName);
[DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put a blank line between each pair of lines so it's mor readable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@safern
Copy link
Member

safern commented Oct 5, 2017

@safern does this suggest a bug in your downloader code (dispose object).

Yes it is possible. I would have to take a look at this specific scenario for uapaot restore.

@danmoseley
Copy link
Member

@dotnet/dnceng can you please look at this one?
https://mc.dot.net/#/user/Anipik/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ab1be0dbb69dde3678f0628974b2a27f045b3286/workItem/System.Data.SqlClient.Stress.Tests/wilogs

2017-10-05 19:42:11,376: INFO: logs(119): __enter__: Creating uploading logger for run_client.py (Client: dnbdb87po000S5U)
2017-10-05 19:42:11,376: INFO: executor(64): run: Set peek-lock abort timer to 2017-10-05 20:12:11.376921
2017-10-05 19:42:11,377: INFO: executor(79): run: Created semaphore file /tmp/helix_active_download_0c27d234-89fd-4125-9ca4-f40b11c3f145.sem, beginning download of payload.
2017-10-05 19:42:11,377: INFO: executor(135): _download_and_unzip: Downloading https://dotnetbuilddrops.blob.core.windows.net/build-70c31483abfe4f5388121d0e89411bab/SupplementalPayload.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r to /home/helixbot/dotnetbuild/work/0c27d234-89fd-4125-9ca4-f40b11c3f145/Work/SupplementalPayload.zip
2017-10-05 19:42:11,377: INFO: executor(158): _download_and_unzip: File '/home/helixbot/dotnetbuild/work/0c27d234-89fd-4125-9ca4-f40b11c3f145/Work/SupplementalPayload.zip' already exists, skipping
2017-10-05 19:42:11,380: INFO: executor(135): _download_and_unzip: Downloading https://dotnetbuilddrops.blob.core.windows.net/build-70c31483abfe4f5388121d0e89411bab/test-runtime-netcoreapp-Linux-Release-x64.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r to /home/helixbot/dotnetbuild/work/0c27d234-89fd-4125-9ca4-f40b11c3f145/Work/test-runtime-netcoreapp-Linux-Release-x64.zip
2017-10-05 19:42:11,380: INFO: executor(158): _download_and_unzip: File '/home/helixbot/dotnetbuild/work/0c27d234-89fd-4125-9ca4-f40b11c3f145/Work/test-runtime-netcoreapp-Linux-Release-x64.zip' already exists, skipping
2017-10-05 19:42:11,383: INFO: executor(86): run: Successfully downloaded payload
2017-10-05 19:42:11,383: INFO: executor(135): _download_and_unzip: Downloading https://dotnetbuilddrops.blob.core.windows.net/build-70c31483abfe4f5388121d0e89411bab/AnyCPU-Release/Tests/netstandard/System.Data.SqlClient.Stress.Tests.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r to /home/helixbot/dotnetbuild/work/0c27d234-89fd-4125-9ca4-f40b11c3f145/Work/1a61d8c8-d371-47b3-bc98-b8706364290a/System.Data.SqlClient.Stress.Tests.zip
2017-10-05 19:42:11,383: INFO: executor(232): _download_to: requesting https://dotnetbuilddrops.blob.core.windows.net/build-70c31483abfe4f5388121d0e89411bab/AnyCPU-Release/Tests/netstandard/System.Data.SqlClient.Stress.Tests.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r
2017-10-05 19:42:56,359: INFO: saferequests(90): request_with_retry: Response complete with status code '200'
2017-10-05 19:42:56,360: INFO: servicebusrepository(79): renew_workitem_lock: renew_workitem_lock Status Code: 200
2017-10-05 19:43:11,396: WARNING: saferequests(70): request_with_retry: Request failed with exception: ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='dotnetbuilddrops.blob.core.windows.net', port=443): Max retries exceeded with url: /build-70c31483abfe4f5388121d0e89411bab/AnyCPU-Release/Tests/netstandard/System.Data.SqlClient.Stress.Tests.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fa7a147e250>, 'Connection to dotnetbuilddrops.blob.core.windows.net timed out. (connect timeout=60)'))",),)
2017-10-05 19:43:41,387: INFO: saferequests(90): request_with_retry: Response complete with status code '200'
2017-10-05 19:43:41,387: INFO: servicebusrepository(79): renew_workitem_lock: renew_workitem_lock Status Code: 200
2017-10-05 19:44:11,439: WARNING: saferequests(70): request_with_retry: Request failed with exception: ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='dotnetbuilddrops.blob.core.windows.net', port=443): Max retries exceeded with url: /build-70c31483abfe4f5388121d0e89411bab/AnyCPU-Release/Tests/netstandard/System.Data.SqlClient.Stress.Tests.zip?sv=2015-04-05&sr=c&sig=Yk88NVRYM4zPytemAgJfD0Hh9hebEBrTLRHEczGjW88%3D&st=2017-10-05T19%3A31%3A29.3346444Z&se=2017-11-04T19%3A31%3A29.3346571Z&sp=r (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fa7a2acac90>, 'Connection to dotnetbuilddrops.blob.core.windows.net timed out. (connect timeout=60)'))",),)
2017-10-05 19:44:11,439: INFO: saferequests(64): request_with_retry: Waiting 1.27147214552 seconds for retry 2
2017-10-05 19:44:26,412: INFO: saferequests(90): request_with_retry: Response complete with status code '200'
2017-10-05 19:44:26,412: INFO: servicebusrepository(79): renew_workitem_lock: renew_workitem_lock Status Code: 200

@mmitche
Copy link
Member

mmitche commented Oct 5, 2017

@jcagme @sunandabalu Seen again

@danmoseley
Copy link
Member

@dotnet/dnceng here's another .. tests worked fine, but wouldn't upload

2017-10-05 20:15:40,004: INFO: azure_storage(205): _upload: Uploading single blob: 'fc95b16a753f47f9ad702898f71946a6.log'
2017-10-05 20:17:47,329: WARNING: saferequests(70): request_with_retry: Request failed with exception: ConnectionError(ProtocolError('Connection aborted.', error(110, 'Connection timed out')),)
2017-10-05 20:19:54,561: WARNING: saferequests(70): request_with_retry: Request failed with exception: ConnectionError(ProtocolError('Connection aborted.', error(110, 'Connection timed out')),)
2017-10-05 20:19:54,561: INFO: saferequests(64): request_with_retry: Waiting 0.74642255864 seconds for retry 2
2017-10-05 20:22:02,561: WARNING: saferequests(70): request_with_retry: Request failed with exception: ConnectionError(ProtocolError('Connection aborted.', error(110, 'Connection timed out')),)
2017-10-05 20:22:02,561: INFO: saferequests(64): request_with_retry: Waiting 1.31579157142 seconds for retry 3

https://mc.dot.net/#/user/Anipik/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/ab1be0dbb69dde3678f0628974b2a27f045b3286/workItem/System.Xml.RW.CustomReader.Tests/wilogs

@danmoseley
Copy link
Member

@safern I see the issue and opened dotnet/buildtools#1724 for you

@Anipik
Copy link
Author

Anipik commented Oct 5, 2017

@danmosemsft I have made the changes you mentioned.

@jcagme
Copy link
Contributor

jcagme commented Oct 5, 2017

@ChulHul FYI in relation to the ticket you are opening. This has happened at least 3 times today.

Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jcagme
Copy link
Contributor

jcagme commented Oct 5, 2017

Azure ticket https://ms.portal.azure.com/#resource/subscriptions/06962174-fd78-47a2-9cf5-96d1e3975117/providers/microsoft.support/supporttickets/117100516451945 tracking this issue

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ViktorHofer ViktorHofer merged commit e6084de into dotnet:master Oct 6, 2017
@danmoseley
Copy link
Member

Yay! Up next : finish tests, and packaging.

@huangsam
Copy link

Was curious if there's still an effort made for porting the Eventing namespace over to C# - I noticed that it does not exist using dotnet run and created a SO post over here: https://stackoverflow.com/questions/46915998/eventing-namespace-does-not-exist-in-system-diagnostics-in-net-core-and-mon

@danmoseley
Copy link
Member

@huangsam I think Eventing is unrelated to EventLog (which relates to Windows event log)
If you are looking for TraceSource, it is in the System.Diagnostics.Tracing namespace. I am not the owner of that area, @brianrob should be abel to clarify where is System.Diagnostics.Eventing.

@danmoseley
Copy link
Member

@huangsam also it would be better to open a new issue to ask not post on an old PR.

@huangsam
Copy link

@danmosemsft @brianrob I created https://github.com/dotnet/corefx/issues/24852 to direct the conversation to the right channels.

pjanotti pushed a commit to pjanotti/corefx that referenced this pull request Oct 31, 2017
* Adding sources for System.Diagnostics.EventLog

* Adding some tests for System.Diagnostics.EventLog
@Genbox
Copy link

Genbox commented Nov 22, 2017

This is built for the old Event Log API (ReadEventLog, OpenEventLog etc.). Since .NET core is not intended for Windows XP, this could have been written with the newer API (EvtOpenLog). The new API supports evt and evtx files along with channels. Using this API means newer logs such as Windows Update Client can't be read as it is defined as a channel.

Edit: Note that the .NET Framework has a perfectly good implementation using the Vista+ API.

@danmoseley
Copy link
Member

danmoseley commented Nov 22, 2017

@Genbox we did a direct port for speed and compatibility. This is not my area, but it seems that System.Diagnostics.Eventing is the preferred way to read channels? This is not ported yet. @brianrob can you please confirm, and also any porting plan?

@Genbox
Copy link

Genbox commented Nov 22, 2017

@danmosemsft It just seems like there is a lot of overlap between the EventLog in this port, and the EventLogReader in System.Diagnostics.Eventing. The System.Diagnostics.Eventing is quite a bit more complex due to the nature of the Vista+ Event Log API's capabilities (bookmarks, channels, XML rendering etc.), but it seems portable.

@danmoseley
Copy link
Member

OK. I'm curious to know why we didn't port it, and whether we can..

@Genbox
Copy link

Genbox commented Nov 22, 2017

@danmosemsft I've read through the code for portability, and it is pretty much just a direct port, except for a few missing attributes which were removed in .NET Core. There are some minor changes related to API (uint to int, moved parameter etc.) as well.

@danmoseley
Copy link
Member

@Genbox could you please open an issue proposing the port? We can discuss there.

@danmoseley
Copy link
Member

Assuming you're interested in port to Windows -- there is already an issue proposing port ot Linux #24852

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Adding sources for System.Diagnostics.EventLog

* Adding some tests for System.Diagnostics.EventLog

Commit migrated from dotnet/corefx@e6084de
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet