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

标签 c# .net clickonce app-config

我正在使用 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/

相关文章:

c# - 如何从在线 .txt 文件中搜索或匹配文本?

c# - 如何在不同(但兼容)模型之间转换 lambda 表达式?

c# - MS UI 自动化 - AddAutomationHandler 未触发

c# - Clickonce - 在 DVD 上部署,使用离线安装程序

c# - clickonce安装下载失败

c# - 发送 ajax POST 请求接收 GET 请求

c# - 带有 EF6 的 System.data.Sqlite

.net - 我可以从 JavaScript (JScript) 或 VBScript 使用 .NET Framework 吗?

.net - 将 publish.htm 添加到 vsto clickonce

c# - 为什么这段代码不打印任何东西?