开发者

System.Configuration in a custom installer class

I have a .NET 2.0 project winforms app. I have another setup installer project.

I've added a custom installer class to the winforms app, that I want to pull some app configuration values to display/allow the user to change during the setup MSI running.

I'm trying to use this example, as it's well documented and makes sense: http://raquila.com/software/configure-app-config-application-settings-during-msi-install/

The probelm I'm running into is that "System.Configuration" is not giving me the "Configuration" object. I have the following code in place:

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开发者_JS百科(stateSaver);

            //get the custom settings

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

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

I'm trying to get the last commented line to work, and it's not working... I'm not sure what I'm doing wrong.


Add a reference to System.Configuration.dll

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜