在安装时更改app.config [英] Change app.config at install time

查看:89
本文介绍了在安装时更改app.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在app.config文件中动态更改connectionString?

How can I dynamically change a connectionString in the app.config file?

我有一个使用Windows窗体,c#3.0和Linq to Sql编写的应用程序。当我安装应用程序时,我需要更改连接字符串。我该怎么办?

I have an application written with windows forms, c# 3.0 and Linq to Sql. I need to change the connection string when i install the application. How i do this?

当用户安装程序时,它必须显示一个表单,其中有一个选项来更改连接字符串(如果存在)或添加一个如果没有。

When the user installs the program it must show a form with an option to change the connection string if exists or add one if it doesn't.

推荐答案

如果您正在使用.NET部署项目,可以通过使用自定义操作来实现。

If you are using a .NET deployment project, can achieve this by using Custom Actions.

这篇关于在安装时更改app.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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