在Windows应用程序中添加新的安装程序类,获取编译器错误 [英] Adding new installer class in windows application getting compiler error

查看:56
本文介绍了在Windows应用程序中添加新的安装程序类,获取编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用设置项目创建了一个寡妇应用程序.我编译并构建.一切看起来都很好.

要在安装过程中更改配置文件,请尝试添加新的安装程序文件.当我默认添加它时,我得到以下代码


I have created a widows application with setup project. I compiled and build.Everything looks fine.

For changing the configuration file during installation am trying to add a new Installer file. when i add it by default i get the below code


Collapse | Copy Code
    
    [RunInstaller(true)]
        public partial class Installer : Installer
        {
            public Installer()
            {
                InitializeComponent();
            }
        }



当我编译这个Am gettin
涉及"windows_setup.Installer"和"windows_setup.Installer"的循环基类依赖项

Windows安装程序是我用于应用程序的名称空间.然后我发现我需要创建不包含Installer的新类.因此我将类名称更改为



When i compile this Am gettin
Circular base class dependency involving ''windows_setup.Installer'' and ''windows_setup.Installer''

windows setup is the name space i used for the application. Then i found that i need to create the new classs which inbherits Installer.So i changed my class name to

public partial class Installer : Installer




现在正在获取

可访问性不一致:与"windows_setup.MyInstaller"类相比,基类"windows_setup.Installer"的访问性较差.

提出您的想法.

谢谢




Now am Getting

Inconsistent accessibility: base class ''windows_setup.Installer'' is less accessible than class ''windows_setup.MyInstaller''

Suggest your ideas.

Thanks

推荐答案

您绝对不应在其自己的名称上扩展类:
You should definitely not extend a class over it''s own name:
public partial class Installer : Installer


给它自己的标识符,当然还有它自己的构造函数:


Give it own identifier, and of course it''s own constructor:

public partial class MyInstaller : Installer


咨询 msdn [ ^ ]


Consult msdn[^]


这篇关于在Windows应用程序中添加新的安装程序类,获取编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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