开发者

How to include app.config file with fsc.exe (F#) or csc.exe (C#)?

开发者 https://www.devze.com 2023-03-07 11:19 出处:网络
I have a console application that uses an app.config file however I can\'t figure out how to include that in the command line parameters so that the output will create the Program.exe.config when I co

I have a console application that uses an app.config file however I can't figure out how to include that in the command line parameters so that the output will create the Program.exe.config when I compile 开发者_开发知识库it programmatically with fsc.exe. Right now my workaround is just to rename app.config to Program.exe.config and copy it to the same output location as Program.exe. What I need is the fsc.exe command line arguments to do this, however I suspect that csc.exe will have something identical or quite close to what fsc.exe does, so if you know what it is in csc.exe I'll try it out.

Bob


I don't think the F# compiler has any built in support for copying app.config to the output directory. Simply copying & renaming the file should do the trick - there is nothing more complicated going on.

If you want to get this done automatically, you can add a post-build event like this:

copy $(ProjectDir)app.config $(TargetDir)$(TargetFileName).config
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号