I've just started working with DNX 1.0.0-rc1-update1 in VS2015. My first app is a 'Console Application (package)' project. Everything works, except NLog logging. I suspect it's because the NLog.config doesn't get copied to the output folder. How can I tell VS to copy this file to the output folder via project.json?
I've tried adding a 'resource' variable like this but it doesn't work:
project.json
...
"resource":"NLog.config",
...
EDIT 1: I'm using dnx451 so compatibility is not an issue.
EDIT 2: I added the following to project.json
"scripts": {
"postbuild": [
"%project:Directory%/../scripts/copy_resources.bat \\\"%project:Directory%\\\" \\\"%project:Directory%/../artifacts/bin/%project:Name%/%project:Version%/dnx451\\\""
]
}
copy_resources.bat
echo "Running script" >> C:\logs\log.txt
echo %1 >> C:\logs\log.txt
echo %2 >> C:\logs\log.txt
xcopy %1\NLog.config %2 /U /Y
There's nothing in the output window in VS to indicate that the script was actually run. Furthermore, log.txt is empty.
How can I debug the build process?
NLog.config
into the assembly. What you are describing in the post is to copy theNLog.config
to the output directory. – Oshinski