C#默认位置中的配置文件? [英] Configuration File in C# default location?

查看:414
本文介绍了C#默认位置中的配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建了WPF应用程序,只是想知道我的app.config文件在哪里?

I have just created a WPF application and just been wondering where is my app.config file?

我在bin / Debug和bin / Release目录中查找了只有一个文件 WpfApplication1.vshost.exe ,找不到任何app.config文件。

I looked in the bin/Debug and bin/Release directories and there is just one file "WpfApplication1.vshost.exe" and could not find any app.config file.

我所能做的就是 Add-> New Configuratin文件,它也不会出现在debug或Release文件夹中。

All I can do is Add->New Configuratin File and this too, doesn't come in debug or Release folder.

有人可以指导我是否应该手动将其复制并粘贴到debug或Release文件夹中吗?

Can anyone guide me whether I should manually copy and paste it in the debug or Release Folder?

最后,请回答:答案

如果app.config不存在,请尝试通过添加->新项->应用程序配置文件创建一个新文件,并创建一个名为 App的文件。配置。之后,尝试重建应用程序,特定于您项目的.config文件应显示在bin / Debug&中。 bin / Release文件夹。

If app.config does not exist, then try creating a new one by "Add->New Item->Application Configuration File" and create a file named "App.config". After this, try rebuilding your application, the .config file specific to your project should appear in bin/Debug & bin/Release folder.

推荐答案

应该应该自动复制到Debug / Release文件夹中。但是,您可以尝试将属性中的复制到输出目录显式设置为始终复制,看看它是否出现。

It should be getting copied into the Debug/Release folders automatically. However, you could try explicitly setting the "Copy to output directory" in the properties to Copy always and see if it appears.

这篇关于C#默认位置中的配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆