There is no EventLog source named ‘ASP.NET x.x.x.’. This module requires .NET Framework x.x

There is no EventLog source named ‘ASP.NET x.x.x.’. This module requires .NET Framework x.x

The above error is thrown because we are trying to log the ASP.Net errors (in most cases, unhandled errors) in to EventLog of the O/S using “WebMonitor.UnhandledExceptionModule” but the required EventLog source is missing. Therefore the fix for this would be to create the missing EventLog source. But where? Below I explain where and how to create the missing EventLog source in the server that you have hosted your site.

Where?

The missing EventLog source should be created in the O/S registry at the following location;

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet001\Services\EventLog\Application

How?

  1. Open the O/S registry by executing the “regedit” command in the “Run”
  2. Browse to the above location in the O/S registry, if there’s already an EventLog source which is pointing to the same .Net Framework as the one your application is running on, then export that key as shown in the screenshot below;

regexport

  1. Then open the exported *.reg file and change the Key name to the missing EventLog source shown in the error message as shown in the screenshot below and save the file;

editexport

  1. Go back to O/S registry again and import the edited *.reg file;

regimport

That’s it, this should fix the issue for you!! If not pls let me know

3 thoughts on “There is no EventLog source named ‘ASP.NET x.x.x.’. This module requires .NET Framework x.x

  1. Nice post, Rasika. I am afraid, however, this workaround cannot solve the problem entirely. As soon as someone’s webengine.dll assembly got updated, the workaround would fail because the file version changed.

    • True. The best is to create your own EventLog source in the code if your are going to log any exceptions in the EventLog of the O/S in your application.
      You can do this by checking the existence of the log source as shown below;

      if(!EventLog.SourceExists(“CustomSource”))
      {
      EventLog.CreateEventSource(“CustomSource”, “Application”);
      }

      Cheers!

  2. i am migrating the project from .net framework 4.0 to 4.6 because in my Application earlier it was tls 1.0 now we updatingTLS 1.2 so from application level i changed targetframework 4.6 and also where we hosted our application in IIS server we updated there TLs 1.2. when we running the application in IIs we are getting this Issue please help me on this Server Error in ‘/Test’ Application.
    ——————————————————————————–

    There is no EventLog source named ‘ASP.NET 4.7.3772.0’. This module requires .NET Framework 2.0.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Exception: There is no EventLog source named ‘ASP.NET 4.7.3772.0’. This module requires .NET Framework 2.0.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [Exception: There is no EventLog source named ‘ASP.NET 4.7.3772.0’. This module requires .NET Framework 2.0.]
    WebMonitor.UnhandledExceptionModule.Init(HttpApplication app) +582
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +580
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

    [HttpException (0x80004005): There is no EventLog source named ‘ASP.NET 4.7.3772.0’. This module requires .NET Framework 2.0.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

Leave a comment