Problems using InstallUtil.exe on my Service

G

Guest

Hi there

I am making a service project in C#, and I'm in the process of writing the installer. I made an installer class by using the "Add Installer" menu-item in the design window of the service, then I configured the properties of the installers

When I run InstallUtil on the executable, it fails with the following message

"An exception occurred while trying to find the installers in the c:\...\obj\debug\MyService.exe assembly
System.Reflection.ReflectionTypeLoadException: One or more of the types in the assembly unable to load
Aborting installation for c:\...\obj\debug\MyService.exe.

This is very weird, because I haven't changed anything manually in the Installer class, so the Installer class is in the assemby and it is public. I checked the generated code and it all seems ok (I compared with code in my .net bible). Still, the utility doesn't find the Installer class

I read some articles on the net, claiming that it could be a version problem. I wouldn't know but I doubt it. I'm running the latest version of InstallUtil (.NET framework 1.1.4322) and I guess the latest C# IDE (7.1.3088). The OS is WinXP Prof./SP1

What could I be doing wrong, or what is going wrong? I can't see any reason. I've added the Installer class from my project at the bottom (comments and non-critical stuff snipped), and also the complete error message

Thank you very much for any help
Tom Tempelaere

<code
using System
using System.Collections
using System.ComponentModel
using System.Configuration.Install

namespace MyServiceNamespac

[RunInstaller(true)
public class ProjectInstaller : System.Configuration.Install.Installe

private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1
private System.ServiceProcess.ServiceInstaller serviceInstaller1
private System.ComponentModel.Container components = null
public ProjectInstaller(

InitializeComponent()

protected override void Dispose( bool disposing

[SNIPPED

private void InitializeComponent(

this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller()
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller()
this.serviceProcessInstaller1.Password = null
this.serviceProcessInstaller1.Username = null
this.Installers.AddRange( new System.Configuration.Install.Installer[]
this.serviceProcessInstaller1, this.serviceInstaller1} )



</code><complete_error_message
Microsoft (R) .NET Framework Installation utility Version 1.1.4322.57
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved

Running a transacted installation

Beginning the Install phase of the installation
See the contents of the log file for the c:\...\debug\MyService.exe assembly's progress
The file is located at c:\...\obj\debug\MyService.InstallLog
Installing assembly 'c:\...\obj\debug\MyService.exe'
Affected parameters are
assemblypath = c:\...\obj\debug\MyService.ex
logfile = c:\...\obj\debug\MyService.InstallLo
An exception occurred while trying to find the installers in the c:\...\debug\MyService.exe assembly
System.Reflection.ReflectionTypeLoadException: One or more of the types in the assembly unable to load
Aborting installation for c:\...\obj\debug\MyService.exe

An exception occurred during the Install phase
System.InvalidOperationException: Unable to get installer types in the c:\...\obj\debug\MyService.exe assembly
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: One or more of the types in the assembly unable to load.

The Rollback phase of the installation is beginning
See the contents of the log file for the c:\...\obj\debug\MyService.exe assembly's progress
The file is located at c:\...\obj\debug\MyService.InstallLog
Rolling back assembly 'c:\...\obj\debug\MyService.exe'
Affected parameters are
assemblypath = c:\...\obj\debug\MyService.ex
logfile = c:\...\obj\debug\MyService.InstallLo
An exception occurred while trying to find the installers in the c:\...\obj\debug\MyService.exe assembly
System.Reflection.ReflectionTypeLoadException: One or more of the types in the assembly unable to load.
Aborting installation for c:\...\obj\debug\MyService.exe.
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to get installer types in the c:\...\obj\debug\MyService.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: One or more of the types in the assembly unable to load..
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.
</complete_error_message>
 
G

Guest

Hi ppl

This is just plain ridiculous. I made a quick try-out service project in C#, and added the installer. Installing works great now, however there is nothing obviously different. I smell a bug in here. If I come to a conclusion I'll post it here

Other suggestions are still welcome

Thanks
Tom.
 
G

Guest

Hi

I've described a way to reproduce the problem in another post: "Service Problem, InstallUtil fails. I'm stuck ..." (7 apr. 04

Thanks
Tom.
 
D

DotNetJunkies User

I just got this error and have been going nuts with it. Now what exactly did you do?

Aaron Abend
800-288-5383 x606
 
D

DotNetJunkies User

I am getting the same error. What exactly did you do? Any help appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top