为什么app.config的控制台应用包含{}

发布于 2025-02-07 11:17:52 字数 831 浏览 1 评论 0原文

<!-- Server Parameters-->
<add key="DatabaseServerName" value="MySqlServer"/>

<!-- Data Access Parameters-->
<add key="DataAccessConnectionString" value="server='{DATABASESERVERNAME}';uid='UserName';pwd=password;database='Database1';Trusted_Connection=Yes;initial catalog='Database1';Async=true; MultipleActiveResultSets=true"/>

我在这里或在Google上找不到有关此的信息。我有一个vb.net控制台应用程序,该应用程序已继承在app.config中,我无法弄清楚为什么它在那里或应该做什么。 {DatabaseserVername}使我感到困惑。它似乎在产品中正常工作,但是当我尝试在开发中使用它时,它失败了。我猜想它是对数据库媒体键中值的某种参数引用,但是我不明白为什么当我尝试运行此功能时它只是不起作用。 DataAccessConneTectionsTring只是带有server ='{databaseservername}'; uid ='username'; pwd = password; database ='database1'; trusted_connection = yes; ointer catalog ='data alog ='database1'; async = true;多重反应Viveresultsets =是的,

有人对此约定一无所知吗?

谢谢

<!-- Server Parameters-->
<add key="DatabaseServerName" value="MySqlServer"/>

<!-- Data Access Parameters-->
<add key="DataAccessConnectionString" value="server='{DATABASESERVERNAME}';uid='UserName';pwd=password;database='Database1';Trusted_Connection=Yes;initial catalog='Database1';Async=true; MultipleActiveResultSets=true"/>

I could not find anything about this here or on Google. I have a VB.Net console app that I have inherited that has tis in the app.config and I cannot figure out why it is there nor what it is supposed to do. The {DATABASESERVERNAME} is confusing to me. It seems to work fine in prod, but it is failing when I try to use it in dev. I am guessing that it some kind of parameter reference to the value in the DatabaseServerName key, but I do not understand why it just doesn't work when I try to run this. The DataAccessConnectionString just comes back with server='{DATABASESERVERNAME}';uid='UserName';pwd=password;database='Database1';Trusted_Connection=Yes;initial catalog='Database1';Async=true; MultipleActiveResultSets=true

Anyone know anything about this convention?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初熏 2025-02-14 11:17:52

我终于找到了。它在代码中被交换了。加载配置时,它被埋在一组嵌套的功能中。史蒂夫做对了。

感谢您的回复。

I finally found it. It is being swapped out in the code. It was buried down inside a nested set of functions while loading the configuration. Steve had it right.

Thanks for the responses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文