为什么app.config的控制台应用包含{}
<!-- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了。它在代码中被交换了。加载配置时,它被埋在一组嵌套的功能中。史蒂夫做对了。
感谢您的回复。
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.