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

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

Exception caught instantiating TERADATA report server extension SQL Reporting Services

you face "ISV code aborted the operation" when you change status of the any record in Dynamics CRM 2013