472,129 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

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

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
2 12295
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
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.

Similar topics

1 post views Thread by Bjoern | last post: by
3 posts views Thread by Mark Assousa | last post: by
2 posts views Thread by =?Utf-8?B?T2xkQnV0U3RpbGxMZWFybmluZw==?= | last post: by
3 posts views Thread by =?Utf-8?B?Sm9uIEphY29icw==?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.