我有一个WinForms2.0项目的.NET应用。我有另一个安装安装程序项目。
我已经在winforms应用程序中添加了一个自定义安装程序类,我想要提取一些应用程序配置值,以便在安装MSI运行期间显示/允许用户更改。
我尝试使用这个例子,因为它有很好的文档记录并且很有意义:http://raquila.com/software/configure-app-config-application-settings-during-msi-install/
我遇到的问题是"System.Configuration“没有给我"Configuration”对象。我已经准备好了以下代码:
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);
}
}
}我正在尝试让最后一行注释行工作,但它不工作...我不确定我做错了什么。
发布于 2010-11-22 05:02:16
添加对System.Configuration.dll的引用
https://stackoverflow.com/questions/4239684
复制相似问题