英文:
How can I have Visual Studio copy nlog.config to Application.exe.nlog?
问题
我正在使用Visual Studio Community 2022版本17.4.0 Preview 2.1。如果我将nlog.config的构建操作设置为Content,它会将一个名为nlog.config的文件复制到输出目录。但如果我将文件重命名为MyApp.exe.nlog,它就不会复制到输出目录,而NLog.Schema也无法正常工作。
如何让Visual Studio将nlog.config复制到Application.exe.nlog到输出目录?在NLog 5中,这是查找配置文件的第一个位置。
英文:
I'm using Visual Studio Community 2022 Version 17.4.0 Preview 2.1. If I use the build action Content for nlog.config, it copies a file named nlog.config to the output. If I rename the file to MyApp.exe.nlog, it doesn't copy it to the output and NLog.Schema doesn't work.
How can I cause visual studio to copy nlog.config to Application.exe.nlog to the output? In NLog 5, this is the first place a config file is looked for.
答案1
得分: 1
我不知道发生了什么变化,但创建 application.exe.nlog,使用生成操作 Content 和复制(如果较新),在项目构建时会导致该文件被复制到输出目录。
英文:
I don't know what changed, but creating application.exe.nlog, using build action Content and copy if newer, results in the file being copied to the output, when the project is built.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论