By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

"Unable to create an instance of the [my installer class] installer type --> Exceptio

P: 1
I am unable to install my windows service and the installutil is throwing the following error:

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the d:\practice in .net\mywindowsservice\mywindowsservice\mywindowsse rvice\bin\practiceservice.exe assembly's progress.
The file is located at d:\practice in .net\mywindowsservice\mywindowsservice\mywindowsse rvice\bin\practiceservice.InstallLog.

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to create an instance of the MyWindowsService.ServiceInstall installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
The inner exception System.NullReferenceException was thrown with the following error message: Object reference not set to an instance of an object..

The Rollback phase of the installation is beginning.
See the contents of the log file for the d:\practice in .net\mywindowsservice\mywindowsservice\mywindowsse rvice\bin\practiceservice.exe assembly's progress.
The file is located at d:\practice in .net\mywindowsservice\mywindowsservice\mywindowsse rvice\bin\practiceservice.InstallLog.
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to create an instance of the MyWindowsService.ServiceInstall installer type.
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception has been thrown by the target of an invocation..
The inner exception System.NullReferenceException was thrown with the following error message: Object reference not set to an instance of an object..
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.


"ServiceInstall" is the class prepared to install the service in my project.

I dont know what is the process .NET uses for instatiating this class for installation but the Visual Studio's auto generated code, automatically created an instance by Mybase.New(), then how this it is not being instantiated.

I dont know where to strike.
Please help me out.


Attaching the code snippet which i used to prepare the installer:

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

components = New System.ComponentModel.Container
components = Nothing

InstallerService = New System.ServiceProcess.ServiceProcessInstaller
InstallerForService = New System.ServiceProcess.ServiceInstaller
Try

ErrorLogger = New ErrorLogging

InstallerService.Account = ServiceAccount.LocalSystem
InstallerService.Username = Nothing
InstallerService.Password = Nothing
'InstallerService.Context.LogMessage("Service being installed in machine" + System.Environment.MachineName())


InstallerForService.StartType = ServiceStartMode.Automatic
InstallerForService.ServiceName = "PracticeService"
InstallerForService.DisplayName = "Practice Service"

'InstallerCollect.Add(InstallerService)
'InstallerCollect.Add(InstallerForService)

Me.Installers.AddRange(New System.Configuration.Install.Installer() {Me.InstallerService, Me.InstallerForService})
ErrorLogger.LogErrorData("PracticeService", "Service being installed in machine" + System.Environment.MachineName())

Catch ex As Exception
ErrorLogger.LogErrorData("Installation", ex.Message)
End Try


End Sub

Thanks
Ashish Jain
Jan 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
Afraid I don't have an answer to your 4 year old problem but do have the same issue. In my case it is with a service which was previously installing fine in VS2008 but, now that I have converted the solution to VS2010 its causing the same log output and exceptions that you have listed.
Feb 4 '11 #2

P: 2
Turns out that it was because of an incorrectly named config file.
Feb 4 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.