I`m interested in using some MOSS dll's if my solution is deployed on MOSS.
For example, if using MOSS, i would like to use built-in logging capabilities.
Is this possible?
I`m interested in using some MOSS dll's if my solution is deployed on MOSS.
For example, if using MOSS, i would like to use built-in logging capabilities.
Is this possible?
Both WSS and MOSS use the same logging framework. There is no MOSS-specific code. See Using Event and Trace Logs in SharePoint.
If you specifically need to detect MOSS, read this post from Muhimbi. Their approach is to detect the existence of certain features that are only provided by MOSS.
Your assembly can reference MOSS assemblies without causing any problems on a WSS installation. It's only when a method from one of the MOSS assemblies is accessed that a problem will occur (FileNotFoundException). If you follow the Muhimbi post and ensure this can never happen then you will have no issues.
Yes, it is possible to log/ trace using the built in MOSS ULS.
See this MSDN article for more details. Based on this code, you can do something like this in your code:
TraceProvider.WriteTrace(0, TraceProvider.TraceSeverity.High, Guid.Empty,
"MyExeName", "Product Name", "Category Name", "Sample Message");