T
timb
Hi,
I have windows service, in the event of an exception calling (which is
important enough to write away to a customer event log) i would like to
write away the software version as part of the evenetlog message text.
I have used the following code with existing windows forms applications
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly
..GetExecutingAssembly.Location).FileVersion ;
but am unable to use it in a windows service due to the following compiler
error.
'System.Reflection.Assembly.GetExecutingAssembly()' denotes a 'method'
which is not valid in the given context
So how do i accomplish this in a windows service and is it the best method
anyway.
I have windows service, in the event of an exception calling (which is
important enough to write away to a customer event log) i would like to
write away the software version as part of the evenetlog message text.
I have used the following code with existing windows forms applications
System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly
..GetExecutingAssembly.Location).FileVersion ;
but am unable to use it in a windows service due to the following compiler
error.
'System.Reflection.Assembly.GetExecutingAssembly()' denotes a 'method'
which is not valid in the given context
So how do i accomplish this in a windows service and is it the best method
anyway.