[.net] Description for event id from source cannot be found

I also stumbled on this - although caused by yet another possibility: the event identifier (which was "obfuscated" in a #define) was setting severity to error (the two high-order bits as stated in Event Identifiers). As Event Viewer displays the event identifier (the low-order 16 bits), there couldn't be a match...

For reference, I've put together a set of tips based in my own research while troubleshooting and fixing this:

  1. If your log entry doesn't end with "the message resource is present but the message is not found in the string/message table" (as opposed to the original question):

    • Means that you're missing registry information
    • Double-check event source name and registry keys
  2. If you need to add/edit registry information, remember to:

    • Restart Event Viewer (as stated in item 6 of KB166902 and also by @JotaBe)
    • If it doesn't help, restart Windows Event Log/EventLog service (or restart the system, as hinted by @BrunoBieri).
  3. If you don't wish to create a custom DLL resource, mind that commonly available event message files have some caveats:

    • They hold a large array of identifiers which attempts to cover most cases
      • .NET EventLogMessages.dll (as hinted by @Matt) goes up to 0xFFFF
      • Windows EventCreate.exe "only" goes up to 0x3E9
    • Every entry contains %1
      • That means that only the first string will be displayed
      • All strings passed to ReportEvent can still be inspected by looking into event details (select the desired event, go to Details tab and expand EventData)
  4. If you're still getting "cannot be found" in your logged events (original question):

    • Double-check event identifier values being used (in my case it was the Qualifiers part of the event identifier)
    • Compare event details (select the desired event, go to Details tab and expand System) with a working example

Examples related to .net

You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to use Bootstrap 4 in ASP.NET Core No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Update .NET web service to use TLS 1.2 EF Core add-migration Build Failed What is the difference between .NET Core and .NET Standard Class Library project types? Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies Nuget connection attempt failed "Unable to load the service index for source" Token based authentication in Web API without any user interface

Examples related to windows

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow'

Examples related to event-log

Write to Windows Application Event Log The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security The source was not found, but some or all event logs could not be searched Description for event id from source cannot be found System.Security.SecurityException when writing to Event Log How to create Windows EventLog source from command line?