0

I have an c# desktop application (.Net4) that when I run it in debug/release mode everything work fine and when I install the program and run it everything work fine except the log module.

My log module work with NLog and it show log messages in grid and write them to csv file.

I work on win7 with admin permissions

Any idea?

Andy
  • 8,432
  • 6
  • 38
  • 76
david
  • 331
  • 2
  • 5
  • 12
  • 1
    You haven;t written if it's a desktop or web application, but take a look at this link: http://stackoverflow.com/questions/1959135/nlog-not-working-in-release-mode. – Lukasz M Sep 12 '12 at 17:02
  • 1
    I can now ee it's a desktop app. Try to put your NLog configuration directly in the *app.config* file. – Lukasz M Sep 12 '12 at 17:08
  • Also, are you sure dll is available in the location where your application is installed? – Lukasz M Sep 12 '12 at 17:09
  • 1
    @LukaszM thanks. I'll check it later, im not near the dev computer now – david Sep 12 '12 at 17:12

2 Answers2

1

Look into your logging configurations. More than likely, your logging is configured to skip non-critital messages in release mode.

Babak Naffas
  • 12,395
  • 3
  • 34
  • 49
  • thanks but its works when I build it to release mode, just when i install it its not working. I'll check soon what you say anyway. – david Sep 12 '12 at 17:08
  • 2
    The installed version would often have a different config file (or none and hence fall-back to some sort of defaults) if it was in a different directory, so configs would be my first thought too. – Jon Hanna Sep 12 '12 at 17:10
0

Make sure all your configs have proper settings. Debug, build and release all are usually different depending on the environment. So make sure your release config actually matches up with the install env.

utsavized
  • 126
  • 2