There is no EventLog source named "ASP.NET 4.6.81.0". This module requires .NET Framework 2.0

I just installed VS 2015 community and while trying to access an ASP.NET application hosted in IIS (using ASP.NET v4.0 application pool) I get a greeter with this error message.

I just downloaded the .NET Framework 4.6 offline installer and it found out about the installation and gave me the option to repair or uninstall it. I decided to repair the installation but didn't fix anything.

Are there any other options available to me?

+1


source to share


4 answers


Try the following:

Go to your web.config and find this block:

<httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add type="WebMonitor.UnhandledExceptionModule" name="UnhandledExceptionModule"/>
    </httpModules>

      



Change the above to the following:

<httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>

      

+2


source


I fixed the problem by running this command line: eventcreate / ID 1 / L APPLICATION / T INFORMATION / SO "ASP.NET 4.6.81.0" / D "My first log"



+15


source


The answers above are correct for the point, however the suggested fix is ​​not perfect.

The UnhandledExcepton module is the third piece of code that is sourced from CodePlex . The goal is to catch exceptions that aren't being handled and log them somewhere. This can be useful, so deleting is not really the answer to this problem.

Also, creating the "ASP.NET 4.6.81.0" event log source is not actually a fix. This may cause you to lose the problem shown here, but it will most likely break again the next time you update the .NET framework.

If you look in the source code, you can see that the module uses the assembly version (WebEngine.dll) that ships with the .NET framework to find the name of the event log source to use. The file can be found in the runtime directory, which will depend on the framework version and "bitness". eg

C:\Windows\Microsoft.NET\Framework\v4.0.30319\WebEngine.dll

      

Violation code:

string webenginePath = Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "webengine.dll");

      

and

FileVersionInfo ver = FileVersionInfo.GetVersionInfo(webenginePath);
sourceName = string.Format(CultureInfo.InvariantCulture, "ASP.NET {0}.{1}.{2}.0", ver.FileMajorPart, ver.FileMinorPart, ver.FileBuildPart);

      

If this log source does not exist, an error occurs.

The reason this is happening now is because .NET 4.6 is replacing .NET 4.5 and not side-by-side. The installation replaced the WebEngine.dll file with the new version 4.6.81.0. The previous version in .NET 4.5.2 was 4.0.30319 (which matched the CLR version).

There is no event log source for " AP.NET 4.6.81.0

", hence an error.

The original author of the UnhandledException module should use code that returns the CLR version and not rely on the file version.

eg.

System.Environment.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      30319  34209

      

If the string that was looking for the environment version used this instead, it will continue to work with the 4.6 framework. Of course, this does not guarantee that it will continue to work in later versions, however it would be a safer choice than file versions.

So the answer is to change the code in the UnhandledExceptionModule to do this, recompile it, and update your references accordingly.

eg.

_sourceName = string.Format(CultureInfo.InvariantCulture, "ASP.NET {0}.{1}.{2}.0",System.Environment.Version.Major, System.Environment.Version.Minor, System.Environment.Version.Build);

      

UPDATE 2015-DEC-04: I fixed this issue and uploaded a new version of the offending class to the original codeplex site. The original author does not seem to be active on the site and so I do not expect the patch to be merged into the original control, but it is available to everyone. See the issue for a description of the issue and the associated patch

+12


source


There is no answer to the above error by removing the httpmodule "WebMonitor.UnhandledExceptionModule". This module is used to catch any unhandled exceptions and register them in the O / S EventLog.

As the error message says, the EventLog source is missing on the server / machine.

Create an EventLog source as described in the following link and you can get rid of this error and also use the O / S event log to log any unhandled exceptions thrown from your application.

How to fix EventLog error

Good luck!

+6


source







All Articles