Web Service and Logging Block

Topics: Logging Application Block
Mar 29, 2007 at 6:11 PM
I made simple web service which receives several strings and populates Word file via Microsoft Word 11.0 Object Library and Office Macros (http://support.microsoft.com/kb/306683). All code is in try/catch blocks and I used Logging Block from Enterprise Library to log received request information, file creation and eventual problems. When web service is tested via ASP.NET Development Server everything work just fine, request and file creation are logged and newly created word file is populated via macro with received data. Problem occurs when I try to test this on IIS (IIS 5.1 on my workstation and IIS 6 on Server 2003), nothing is logged and new word file is not populated with data(this last problem isn't for this group, I know :-)). I would appreciate any help in solving this problem.
Development Environment is Visual Studio 2005 Pro and Enterprise Library January 2006.
(I also tried LoggingQuickStart and when I log some log entry nothing is logged in trace file or Event Log. When I try to open App.config file in Enterprise Library Configuration tool I receive error message and there isn't Logging Configuration in Enterprise Library Configuration tool tree, but the configuration data is written and it's there if I open App.config in notepad)
Mar 30, 2007 at 2:31 PM
Are you sure the web service is being called / run on the other machines? I would step through a debugger and just verify it because:

1) The Word File is not being populated
2) If the configuration file was incorrect, you would get a configuration error on app startup

If you think the logging is just erroring out somewhere, make sure you are logging the Logging Errors & Warning Special Sources to a TraceListener so that if the Logging Application Block is having a problem you will know it. Choose an EventLog or other source you know should get the error messages.

Make sure you are also using the same version of Enterprise Library, too. The configurations are different from Ent Lib 1.1 and 2.0, and they work on different versions of the .NET Framework.




David Hayden
Microsoft MVP C#