We are using Microsoft's Composite Application Block and Smartclient Software Factory.
I am trying to add Nlog to our application - which from a programming aspect doesn't seem to be difficult. But when I configure the NLog output to go to a Console, it isn't happening. If the target is a file, it writes there with no problem. But to a console it just blows thru the code and nothing appears.
Has anyone tried to use the console as a target with CAB? Maybe somehow it is preventing the presentation of the Console.
More follow up - I added the parameters in the Nlog config file of throwExceptions="true" and to write its internal log file to a text file. No errors were thrown, and the text file written is not showing any errors. Lists loading targets, etc. and stuff that looks "normal".
Ok - zip file should be attached. This is all done with VS 2005 and NET 2.0.
I created a new application using the Smart Client Software Factory. That creates a "shell" (think of it as a MDI Parent) and other libraries. In one of the librairies, I created a "view". Simple user object with a button on it. In that same library, there is a ModuleController.cs. In that, I added the lines needed to show the view within the shell. I also added a reference to NLog there, and a line to write out to NLog. I have an NLog.config file in the bin/debug directory that has targets for a messagebox, console, and file (file is written a log.txt in a /log directory).
Run the application, and the view should appear. But the messagebox and console do not open. However, the entry is written to file.txt.
To enable console, change your project output type to "Console Application" in Project Properties. Unfortunately NLog doesn't allocate console if it's not present, but this may be improved in future versions.
As for the MsgBox - looks like you found a bug. I'm working on it and will let you know when the fix is available.