Code Coverage by Clover.NET

Using with CF 2.0?

View: New views
3 Messages — Rating Filter:   Alert me  

Using with CF 2.0?

by Alex O. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Everybody,

I am having a toughest time trying to get it to work with Windows CE 5.0 (I use the CE emulator for testing) and CF 2.0.  Has anyone used it in that combination? I tried the console and file targets, but I get nothing logged at all...

The CF 2.0 binaries available from Sourceforge for ARM platform only, so I had downloaded the sources and built NLog from scratch in VS2005.

First problem was that for some reason VS2005 ignores the configuration file during the deployment, so I had to transfer it to the target manually.  I tried all documented names for the config file to no avail.

So, I decided to use the API to create the configuration programmatically, but apparently it does not work with Compact Framework as I get PlatformNotSupported exception in mscorlib assembly for the FileTarget object.

Any suggestions would be greatly appreciated.
Thank you in advance.

P.S. Everything works fine in my test C#.NET console application for desktop (standard .NET v.2.0).

Re: Using with CF 2.0?

by Alex O. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Never mind, I solved it.

Turns out that the log file was being created in the root folder even though the application resides under \Program Files\AppFolder.

The console logging was not working because the CE Emulator image lacked the Console component.

BTW, in order for the NLog.config file to be transferred to your target device during deployment you have to make two changes in the file properties:

1. Set "Copy to Output Folder" to "Always"
2. Set "Build Action" to "Content"

Hope, this helps someone else.

Re: Using with CF 2.0?

by Happy Pig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was having a similar problem using CF2.0 on Pocket PC in that I had to manually copy the nlog config file to the device, setting properties as in steps 1 and 2 means I no longer have to do it manually, Thanks Alex.