为什么我的卸载方法不会被调用? [英] Why is my Uninstall method not being called?
本文介绍了为什么我的卸载方法不会被调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
2008年我国VS创建安装程序不会调用覆盖卸载
方法,在我的安装程序类。为什么?该安装
方法被调用。
我的安装程序类看起来是这样的:
My VS 2008 created installer doesn't call the override Uninstall
method in my installer class. why? The Install
method was called.
My installer class looks like this:
[RunInstaller(true)]
public partial class InstallerClass : Installer
{
public InstallerClass()
{
InitializeComponent();
}
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
//encrypt connection string
encryptConntStr();
//create database
createDatabase();
}
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
}
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
System.Diagnostics.Debugger.Break();
MessageBox.Show("I am in Uninstall now.");
string exePathStr = Context.Parameters["targetdir"];
...
}
}
编辑:
推荐答案
确认CustomActionData属性不为空。有些是怎么回事空在我的情况,并会导致问题。
make sure the CustomActionData property is not empty. Some how it was empty in my case and cause that problem.
这篇关于为什么我的卸载方法不会被调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文