An Error occured while creating EventSource, The Source and Log properties must be matched, or you may set Log to the empty string

If you get
"
The source 'xxx SourceName' is not registered in log 'xxx LogName'. (It is registered in log 'Application'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property.
"

while calling System.Diagnostics.EventLog.CreateEventSource with sourceName and LogName params,Just check registry whether SourceName is not registered in any other LogName(s).
Verify LogName and SourceName in the Operationg Sytem is unique via REGEDIT;
HKLM\System\CurrentControlSet\services\eventlog\|...
if it is defined previously, you can not create . You must delete or change SourceName.


regards,
P.S:Please do not hesitate to share your comments.

Comments

Popular posts from this blog

Assembly Microsoft.Dynamics.Service.Plugins.dll can not be loaded. Dynamics CRM 365 Engine version 9 - CRM User creation error

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified at Configuration class initiation in CrmServiceHelper.cv