[英]Compile App.config XML file along with console.exe application C#
Surely I have missed something simple here. 我肯定在这里错过了一些简单的事情。 I used the link below to help me create a configuration file which I can use in my console application.
我使用下面的链接来帮助我创建可以在控制台应用程序中使用的配置文件。
Simplest way to have a configuration file in a Windows Forms C# Application 在Windows Forms C#应用程序中拥有配置文件的最简单方法
<configuration>
<appSettings>
<add key="setting1" value="key"/>
</appSettings>
</configuration>
I have built my console application, but can't see the app.config file anywhere. 我已经构建了控制台应用程序,但是在任何地方都看不到app.config文件。 I'd like to edit this configuration file without recompiling.
我想编辑此配置文件而无需重新编译。
Any idea on how to do this ? 关于如何执行此操作的任何想法? Basically, I'm passing the compiled console app to someone, and wont be providing the source code, so I have provided an .xml document which I hope they'll be able to edit after the console app has been compiled.
基本上,我将已编译的控制台应用程序传递给某人,并且不会提供源代码,因此我提供了一个.xml文档,希望他们能够在控制台应用程序编译后进行编辑。
Thanks 谢谢
You need click on your project in Solution explorer, select Add File
option and choose app.config. 您需要在解决方案资源管理器中单击您的项目,选择“
Add File
选项,然后选择“ app.config”。 When you will rebuild solution file will by added configuration file like your_application.exe.config
当您重建解决方案文件时,将通过添加配置文件(例如
your_application.exe.config
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.