gpt4 book ai didi

c# - .NET 单击一次部署 App.config

转载 作者:太空宇宙 更新时间:2023-11-03 20:32:15 26 4
gpt4 key购买 nike

我正在使用 VS2008 SP1 ClickOnce Deployment 来部署应用程序。该应用程序引用一个 Web 服务,该服务将连接详细信息存储在 app.config 文件中。例如,存储以下内容:

<client>
<endpoint address="http://someservice.com/someservice" binding="customBinding" bindingConfiguration="ServiceSoapBinding" contract="AService.AService" name="AServicePort" behaviorConfiguration="endPointBehavior"/>
</client>

我需要能够在已部署的应用程序上验证此端点地址的值。我可以完全访问服务器上每个已部署的文件,但我没有看到对任何 app.config 条目的引用。

app.config 设置存储在已发布数据中的什么位置,我如何访问它们?

亲切的问候,
F.

最佳答案

Application settings consumes two files: app.exe.config and user.config, where app is the name of your Windows Forms application. user.config is created on the client the first time your application stores user-scoped settings. app.exe.config, by contrast, will exist prior to deployment if you define default values for settings. Visual Studio will include this file automatically when you use its Publish command. If you create your ClickOnce application using Mage.exe or MageUI.exe, you must make sure this file is included with your application's other files when you populate your application manifest.

Source

它的名称是 app.exe.config.deploy,它位于版本文件夹下的 Application Files 文件夹下的顶级文件夹中。

例如,如果您的应用部署到“C:\App”,那么它将位于“C:\App\Application Files\DirectoryPerVersion\ProjectName.exe.config。部署

关于c# - .NET 单击一次部署 App.config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6925774/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com