.net 安装包制作

1、编译之后,安装之后,没有卸载,再编译,再安装出错

    解决办法:添加删除程序里面删除安装过的文件。

2、判断是否虚拟目录存在

    直接用: DirectoryEntry   Exist = root.Children.Find(virtualdir, root.SchemaClassName);

            出错:{"系统找不到指定的路径。 (异常来自 HRESULT:0x80070003)"}

    需要先创建 。感觉如果没有就出错,具体原因不知道, xp、vs2005开发。

    解决办法:加个 try  catch

 DirectoryEntry Exist;
            try
            {
                 Exist = root.Children.Find(virtualdir, root.SchemaClassName);
            }
            catch
            {
                Exist = null;
            }

            if (Exist != null)
            {
                //删除虚拟目录
                root.Children.Remove(Exist);
                root.CommitChanges();
            }

原文地址:https://www.cnblogs.com/lgzh3/p/2638068.html