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

Complex Query in QueryExpression in Microsoft CRM 2011

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Microsoft Power Apps Portal integration with Dynamics 365 CE On-Premise - Step By Step Guide