Many thanks Alf. See me reply today (to myself) which duduced the same
thing. However, I did try creating a class derived from ProjectInstaller but
register new event sources. Hence the reason I am creating the event sources
"Alf Tore Haaland" <alfen@start.nospam> wrote in message
news:opr7qcu9td20idsq@alfen...
> You need to run InstallUtil.exe.
>
> See Event Security in the Enterprise Instrumentation doc.
>
>
> Logging Events to the Windows Event Log
> The ASPNET account does not have sufficient privileges to register a
> Windows Event Log event source, but does have sufficient privileges to
> write events to the Application Event Log assuming the event source has
> already been registered by an administrator. To ensure events are logged
> as expected to the Application Event Log, make sure that the local user is
> a local administrator before running InstallUtil against the application's
> instrumented assemblies. For more information, see Registering an Event
> Source and Assembly Installation with InstallUtil.exe.
>
> Enterprise Instrumentation automatically registers Event Log event sources
> for you as it scans your instrumented assemblies during this installation
> phase, provided you have implemented a standard ProjectInstaller class.
>
> Note It is not sufficient to deploy an ASP.NET Web application to a
> server via file-copy alone. You must run Installutil.exe against the
> application's instrumented assemblies to ensure the Event Log event
> sources are registered.
>
>
> On Fri, 7 May 2004 01:06:23 +0100, Graham Allwood
> <graham.allwood@nospamtoEborsolutions.com> wrote:
>
> > I think this must be a faq, but can I find the answer - no.
> >
> > I successfully used the logging app block in my windows app (sample
> > test),
> > but I'm now putting it in to my web services. When I try am raise an
> > event
> > from the web services I'm getting an Error in the event log from EIF,
> > saying
> > that the LogEventSink cannot be used because a Security Exception was
> > thown,
> > as below:
> >
> >
> > Event Type: Error
> > Event Source: Enterprise Instrumentation
> > Event Category: None
> > Event ID: 0
> > Date: 07/05/2004
> > Time: 00:55:11
> > User: N/A
> > Computer: GRAVYXP
> > Description:
> > Error loading an Event Sink of type
> > 'Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink,
> > Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
> > Culture=neutral, PublicKeyToken=490cbe481ee0124d'. The Event Source of
> > name
> > 'Application' will not write events out to this Event Sink. The
following
> > exception was returned during the load:
> >
> > System.Reflection.TargetInvocationException: Exception has been thrown
by
> > the target of an invocation. ---> System.Security.SecurityException:
> > Requested registry access is not allowed.
> > at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean
> > writable)
> > at System.Diagnostics.EventLog.FindSourceRegistration(String source,
> > String machineName, Boolean readOnly)
> > at System.Diagnostics.EventLog.SourceExists(String source, String
> > machineName)
> > at System.Diagnostics.EventLog.SourceExists(String source)
> > at
> >
Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.CreateEventSourc
> > e()
> > at
> >
Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink..ctor(IDictionar
> > y parameters, EventSource eventSource)
> > --- End of inner exception stack trace ---
> > at
> > System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags
> > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
> > Boolean
> > isBinderDefault)
> > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags
> > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
> > Binder
> > binder, Object[] args, CultureInfo culture, Object[]
> > activationAttributes)
> > at System.Activator.CreateInstance(Type type, BindingFlags
> > bindingAttr,
> > Binder binder, Object[] args, CultureInfo culture, Object[]
> > activationAttributes)
> > at System.Reflection.Assembly.CreateInstance(String typeName, Boolean
> > ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
> > CultureInfo culture, Object[] activationAttributes)
> > at
> >
Microsoft.EnterpriseInstrumentation.EventSinks.EventSink.CreateNewEventSinks
> > (DataRow[] eventSinkRows, EventSource eventSource)
> >
> > For more information, see Help and Support Center at
> >
http://go.microsoft.com/fwlink/events.asp. > >
> >
> > Thanks for any help.
> >
> > Graham
> >
> >
>
>
>
> --
> Using M2, Opera's revolutionary e-mail client:
http://www.opera.com/m2/