首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自定义安装程序类中的System.Configuration

自定义安装程序类中的System.Configuration
EN

Stack Overflow用户
提问于 2010-11-22 03:03:31
回答 1查看 996关注 0票数 0

我有一个WinForms2.0项目的.NET应用。我有另一个安装安装程序项目。

我已经在winforms应用程序中添加了一个自定义安装程序类,我想要提取一些应用程序配置值,以便在安装MSI运行期间显示/允许用户更改。

我尝试使用这个例子,因为它有很好的文档记录并且很有意义:http://raquila.com/software/configure-app-config-application-settings-during-msi-install/

我遇到的问题是"System.Configuration“没有给我"Configuration”对象。我已经准备好了以下代码:

代码语言:javascript
复制
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Configuration;


namespace BadgeReader
{
    [RunInstaller(true)]
    public partial class InstallerSettings : System.Configuration.Install.Installer
    {
        public InstallerSettings()
        {
            InitializeComponent();
        }

        public override void Install(System.Collections.IDictionary stateSaver)
        {
            base.Install(stateSaver);

            //get the custom settings

            //System.Diagnostics.Debugger.Break();

             System.Configuration
            //Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);
        }
    }
}

我正在尝试让最后一行注释行工作,但它不工作...我不确定我做错了什么。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-11-22 05:02:16

添加对System.Configuration.dll的引用

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4239684

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档