简体   繁体   English

与console.exe应用程序C#一起编译App.config XML文件

[英]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.

相关问题 控制台应用程序中的 App.Config 文件 C# - App.Config file in console application C# 如何在VS2010 C#控制台应用程序中将我的App.config编译到我的exe中? - How do I compile my App.config into my exe in a VS2010 C# console app? 在c#控制台应用程序中,app.config的替代方案是什么? - What is the alternate to app.config in c# console application? 在 C# 控制台应用程序 app.config 中嵌入 webclient 的凭据? - Embed credentials for webclient in C# Console Application app.config? 循环通过 App.Config 文件并将每个值存储在 C# 控制台应用程序的变量中? - Loop Through App.Config file and store each value in variable for C# Console Application? 如何将 app.config 文件添加到项目(控制台应用程序 C#) - How to add an app.config file to a project (Console Application C#) 如何在Windows应用程序C#中更改app.config文件 - How to change app.config file in window application c# 查询App.config和AppName.exe.config-C# - Query on App.config and AppName.exe.config - C# 如何通过 Z240AA3 控制台中的 App.config 文件控制 static html 页面的动态 html 表的样式? - How to control styling of a dynamic html table of a static html page through App.config file in a c# console application? C#app.config文件 - C# app.config file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM