| rlrcstr wrote: |
|
If anyone can provide insight as to how to stop this association, I'd still like to know... Thanks.
I'm using C# and .Net 2.0 - I'm logging to a custom log and I see no need to add an Event Source that will never be used.
J
| |
Did my earlier post not work for you? It's not much more programming. And it will stop the association as described.
http://msdn2.microsoft.com/en-us/library/49dwckkz(vs.71).aspx
Article on similar problems:
http://www.thescripts.com/forum/thread245902.html
Creating a resource file
http://msdn2.microsoft.com/en-us/library/system.diagnostics.eventloginstaller.categoryresourcefile.aspx
http://msdn2.microsoft.com/en-us/library/aa385633.aspx
A snippet of my code:
public class ServiceLogger
{
private EventLog m_eventlog = null;
private String m_sourceApplicationName = null;
private String m_logClassName = "Leon";
private String m_machineName = null;
private System.Diagnostics.EventSourceCreationData eventCreationData;
public ServiceLogger(String sourceAppName, String logClassName, String machineName)
{
//
// TODO: Simple constructor. Needs exception handling
//
m_sourceApplicationName = sourceAppName.Trim();
if(logClassName != null && logClassName.Trim().Length > 0)
m_logClassName = logClassName.Trim();
if(machineName != null && machineName.Trim().Length > 0)
m_machineName = machineName.Trim();
else
m_machineName = Environment.MachineName;
eventCreationData = new System.Diagnostics.EventSourceCreationData(m_sourceApplicationName,m_logClassName);
eventCreationData.CategoryCount = 9;
eventCreationData.CategoryResourceFile = "E:\\My Documents\\SharpDevelop Projects\\MyWindowsService\\MyWindowsService.dll";
eventCreationData.MessageResourceFile = "E:\\My Documents\\SharpDevelop Projects\\MyWindowsService\\MyWindowsService.dll";
}