Users are not able to install a ClickOnce application. The error is: "File NLog.dll is not a valid Portable Executable (PE) file." It works fine on my machine, but I have nLog installed. That's not possible for client machines. Any ideas how to get this to work?
Check your build option and make sure NLog.dll is included in the "Application Files", so that it will be in "download group"/required.
Add the dll to your project and set BuildAction = None, and "copy to output directory" as "do not copy".
Delete your reference to NLog in your project. Re-add the reference and point it to the dll you just added to the project. On the properties of the reference, set "Copy local" to "true".
Now when YOU run the application, it will point to the local version, and when you deploy the application, it will deploy the local version and point to it.
This works for many 3rd party DLL's, but not all. The best thing to do is to try it.
I put all the NLog config data into the App.config file instead of the NLog.config file and it worked for me after deploying with ClickOnce as well. No errors and the logging was working on the deployed application.