I've copied this answer from here (the question was Log4Net but the answer still applies). The technet link misses a vital step.
Create a registry key
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetserviceseventlogApplicationMY-AWESOME-APP
Create a string value inside this
Name it EventMessageFile
, set its value to
C:WindowsMicrosoft.NETFrameworkv2.0.50727EventLogMessages.dll
That path appears to work in both 64 bit and 32 bit environments.
With this technique you don't need to set permissions in the registry, and once the key above is created it should just work.
Alternatively
If you don't have a large server farm but just a small "web garden" you could run a console application on each server that creates the event log source using EventLog.CreateEventSource
, make sure the console application is run by an administrator.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…