为App.config使用不同的文件名 [英] Using a different filename for App.config

查看:85
本文介绍了为App.config使用不同的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


默认情况下,当您创建App.config文件时,它会在构建后命名为

MyApp.exe.config。我不喜欢这个名字而宁愿使用名为MyApp.config的文件
,.exe.config可能会让我的用户感到困惑。有没有办法做到这一点,或者我坚持使用

MyApp.exe.config ??


谢谢。

Hello,

By default, when you create an App.config file it gets named as
MyApp.exe.config after build. I don''t like this name and would rather
have the file named MyApp.config, the .exe.config thing might confuse
my users. Is there any way to do this, or am I stuck with
MyApp.exe.config??

Thanks.

推荐答案




< sh **** @ gmail.com>在消息中写道

news:11 ********************* @ f14g2000cwb.googlegro ups.com ...
Hi,

<sh****@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
你好,

默认情况下,当你创建一个App.config文件时,它在构建后被命名为
MyApp.exe.config。我不喜欢这个名字,并且宁愿让文件名为MyApp.config,.exe.config可能会让我的用户感到困惑。有没有办法做到这一点,或者我坚持使用
MyApp.exe.config ??
Hello,

By default, when you create an App.config file it gets named as
MyApp.exe.config after build. I don''t like this name and would rather
have the file named MyApp.config, the .exe.config thing might confuse
my users. Is there any way to do this, or am I stuck with
MyApp.exe.config??




AFAIK没有办法改变它如果你想要使用提供的框架

类,当然没有什么可以阻止你创建自己的

文件(和格式),只是从这个文件中读取配置,这只是

你将不得不提供所有功能。


-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局



AFAIK there is no way to change it IF you want to use the framework supplied
classes, of course there is nothing to prevent you from creating your own
file (and format ) and just read the configuration from this file, it''s just
that you will have to c reate all the functionality.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


除了滚动你自己配置,你被卡住了,我相信。


你可以为你的appSettings指定一个外部文件,但是,如果那是'

你的但是,用户需要捣乱。我完全不记得

参数名称,但是如果你使用VS 2005,你可以去

appSettings secion,并获得intellisense appSettings上的设置

部分。它看起来像这样:

< appSettings file =" myApp.config" />

所有键/值对都将移动到myApp.config中。我也不相信

它必须以.config结尾。


如果你是以编程方式表达我的经验修改你的

appSettings,你会遇到问题。


" sh **** @ gmail.com"写道:
Aside from rolling your own config, you''re stuck, I believe.

You can specify an external file for your appSettings, though, if that''s
what your users are going to need to mess with, though. I don''t remember the
parameter name exactly, but if you''re using VS 2005, you can go to the
appSettings secion, and get intellisense for the settings on the appSettings
section. It will look something like this:
<appSettings file="myApp.config" />
All key/value pairs would move into myApp.config. I also don''t believe that
it has to end with .config.

It''s been my experience that if you''re programatically modifying your
appSettings, you''ll have problems.

"sh****@gmail.com" wrote:
你好,

默认情况下,当你创建一个App.config文件时,它在构建后被命名为
MyApp.exe.config 。我不喜欢这个名字,并且宁愿让文件名为MyApp.config,.exe.config可能会让我的用户感到困惑。有没有办法做到这一点,或者我坚持使用
MyApp.exe.config ??

谢谢。
Hello,

By default, when you create an App.config file it gets named as
MyApp.exe.config after build. I don''t like this name and would rather
have the file named MyApp.config, the .exe.config thing might confuse
my users. Is there any way to do this, or am I stuck with
MyApp.exe.config??

Thanks.



嗯...让您的用户感到困惑?他们不应该看着它

无论如何(默认情况下,他们中的大多数人甚至都看不到

Windows资源管理器中的扩展名)。但更重要的是,怎么样 :混淆你的代码的未来维护者或者混淆你的应用程序的管理员




没有理由这样做。

ummm... confusing to your users? they shouldn''t be looking at it
anyhow (by default, most of them won''t even see the extension in
Windows Explorer). But more importantly, how about: confusing to
future maintainers of your code or confusing to the administrator of
your app?

There is no reason to do this.


这篇关于为App.config使用不同的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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