[英]System.Configuration in a custom installer class
我有一個.NET 2.0項目Winforms應用程序。 我有另一個安裝程序安裝程序項目。
我已經向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);
}
}
}
我正在嘗試使最后一條評論行起作用,但它不起作用...我不確定自己在做什么錯。
添加對System.Configuration.dll
的引用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.