Often you may feel the need to have your own source to log events when building BizTalk applications. Creating sources through code requires elevation. One simple way to do this is to use .reg files.
Lets assume you want to create a source called “MyApplicationSource”.
1) Open Wordpad.
2) Type the following:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\MyApplicationSource]
“EventMessageFile”=”C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\EventLogMessages.dll”
3) Save the file as txt (MSDOS format). This is important.
4) Double click on the file and the source will be created for you.
Important: Take extreme caution when modifying the registry. It always a good idea to create a restore point before making any changes to the registry.