i created a Custom Trace Liastener inside a class library :
namespace SendMailTraceListener
{
[ConfigurationElementType(typeof(CustomTraceListenerData))]
public class SendEmailTraceListener : CustomTraceListener
{
public override void Write(string message)
{
throw new NotImplementedException();
}
public override void WriteLine(string message)
{
throw new NotImplementedException();
}
}
}
it compiles fine.
Then, in Enterprise Library 4.1, i created new Custom TraceListener and pushed the "Type" button in the TraceListener properties to open the "Type selector" window.
i pushed "Load from file" button and browsed to the Custom Trace Listener class library and chose the dll from the Bin->Debug folder of the class library.
but it doesn't work, i get the message:
"There were no types found in the assembly 'SendMailTraceListener' that implement or inherit from the base type 'Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.CustomTraceListener'."
Why ? !!!
Got it!
It is a Visual Studio 2008 bug.
when i used the Enterprise Library Configuration application itself ( not the VS2008 -right clicking on the config file and choosing "Edit Enterprise Library Configuration" ) , it works!