none
Microsoft's System.Diagnostics.EventLog example not working on Windows 10 + Visual Studio 2015

    Question

  • Here's my VS info:

    Microsoft Visual Studio Professional 2015
    Version 14.0.25431.01 Update 3
    Microsoft .NET Framework
    Version 4.7.02046

    Installed Version: Professional

    Visual Basic 2015   00322-50050-55420-AA803
    Microsoft Visual Basic 2015

    Visual C# 2015   00322-50050-55420-AA803
    Microsoft Visual C# 2015

    Visual C++ 2015   00322-50050-55420-AA803
    Microsoft Visual C++ 2015

    Application Insights Tools for Visual Studio Package   7.18.00214.2
    Application Insights Tools for Visual Studio

    ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
    ASP.NET and Web Tools 2015.1 (Beta8)

    ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
    For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

    ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
    For additional information, visit http://www.asp.net/

    Common Azure Tools   1.8
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

    JavaScript Language Service   2.0
    JavaScript Language Service

    JavaScript Project System   2.0
    JavaScript Project System

    Microsoft Azure Mobile Services Tools   1.4
    Microsoft Azure Mobile Services Tools

    NuGet Package Manager   3.4.4
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    PreEmptive Analytics Visualizer   1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    SQL Server Data Tools   14.0.60519.0
    Microsoft SQL Server Data Tools

    TypeScript   1.8.36.0
    TypeScript tools for Visual Studio

    VsVim   2.3.0.0
    VsVim is a Vim emulator for Visual Studio


    Here is my system info:
    Edition: Windows 10 Pro
    Version: 1703
    OS Build 15063.138




    I'm running the example from this link in Administrator mode:
    https://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog(v=vs.110).aspx

    I've ran it twice, as instructed. I've restarted after execution and ran it again.
    After all I have done, there are still zero logs in the Event viewer. I'm looking under:
    Windows Logs => Application.

    Please help me understand what I'm doing wrong here.
    Tuesday, May 2, 2017 2:23 PM

Answers

  • The example calls EventLog.CreateEventSource("MySource", "MyNewLog"). This should add "MyNewLog" under "Applications and Services Logs", not under "Windows Logs".
    • Marked as answer by SOMA11 Wednesday, May 3, 2017 1:10 PM
    Tuesday, May 2, 2017 7:22 PM

All replies

  • The example calls EventLog.CreateEventSource("MySource", "MyNewLog"). This should add "MyNewLog" under "Applications and Services Logs", not under "Windows Logs".
    • Marked as answer by SOMA11 Wednesday, May 3, 2017 1:10 PM
    Tuesday, May 2, 2017 7:22 PM
  • That was it. Thank you.
    Wednesday, May 3, 2017 1:10 PM