Windows 安装程序出错...“无法获取安装程序类型" [英] Error with Windows Installer ... "Unable to get installer types"

查看:16
本文介绍了Windows 安装程序出错...“无法获取安装程序类型"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Windows 安装程序在我正在部署的产品中安装事件源时遇到错误.

I'm experiencing an error when using the windows installer to install an event source in a product I am deploying.

我收到的错误消息说明如下...

The error message I receive states the following ...

无法获取安装程序类型c: empprogram.exe 程序集.-->无法加载一个或多个请求的类型.检索LoaderExceptions 属性更多信息.

Unable to get installer types in the c: empprogram.exe assembly. --> Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

这是创建事件源安装程序的代码块...

Here is the block of code that creates the event source installer ...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;

namespace myapplication
{
    [RunInstaller(true)]
    public partial class EventSourceInstaller : Installer
    {
        public EventSourceInstaller()
        {
            InitializeComponent();

            string eventSourceName = "MyAppSourceName";
            if (!EventLog.SourceExists(eventSourceName))
            {
                EventSourceCreationData data = new EventSourceCreationData(eventSourceName, "Application");
                EventLog.CreateEventSource(data);
                EventLog.WriteEntry(eventSourceName, "Source Added.");
            }
        }
    }
}

在安装程序项目中,我在安装上添加了一个名为来自 MyApplication (Active) 的主要输出"的自定义操作,以运行事件源安装程序.

In the installer project I've added a custom action on Install named "Primary output from MyApplication (Active)" to run the event source installer.

我有以下问题

  1. 有没有其他人遇到过这个问题?问题是什么?

  1. Has anyone else run across this and what was the issue?

如何检索安装程序的 LoaderExceptions 属性?

How do I go about retrieving the LoaderExceptions property of the installer?

推荐答案

我从来没有见过那个错误,但是路径 c: empprogram.exe 很奇怪.您是否尝试从 c: emp 目录运行安装程序?

I have never seen that error, but the path c: empprogram.exe is very strange. Are you trying to run the installer from the c: emp directory?

您确定您使用的所有项目和所有第三方 DLL 的输出都包含在部署项目中吗?单击部署项目中所有包含的文件并检查它们的 SourcePath 属性;它们是原始源文件而不是目标输出文件夹吗?不是临时文件夹?

Are you certain the output of all projects and all third-party DLLs you use are included in the Deployment project? Click on all included files in the Deployment project and check their SourcePath property; are they to the original source files and not the target output folder? Not the temp folder?

这篇关于Windows 安装程序出错...“无法获取安装程序类型"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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