views:

17

answers:

0

Say I have an application that reads a centralized ErrorLog called LogViewer it is mirrored in a few formats (winforms, silverlight, asp.net, asp.net mvc, etc)

Project Names for the actual publish/deployment would be different for each one. Where would I best store the name LogViewer vs LogViewer WinForm (or LogViewer silverlight,etc) that I would be able to tell them apart in a reflection based Logging assembly?

For example Project Name, Assembly Title, Assembly Product, FileName, where would each of these be stored and how would I pull them back with reflection within a referenced DLL method call?

The goal is to write a logging DLL that would automatically read the EntryAssembly's information once on initialization, and then use that to save off messages and exceptions to the log server.

So far I'm doing this to capture the File Version and EntryAssembly's (hopefully this will refer to the 'master assembly') basic information.

var assembly = System.Reflection.Assembly.GetEntryAssembly();
   Debug.Assert(assembly.Location != null);
   var fileVersion = new System.IO.FileInfo(assembly.Location);