473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 12734
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

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

Similar topics

10
by: Whitney Kew | last post by:
Hello, I have a question regarding type conversion operators. Let's say I have a simple (nonsensical) class as follows: class MakeNewInt { private: int* _n;
1
by: Bjoern | last post by:
I have a name of a class and the corresponding assembly. Now I want to create an object of this class. I think it is should work with Reflection. But I don't know how exactly. Could someone...
3
by: Mark Assousa | last post by:
Hi, I'm having trouble finding the right news group for this posting so here goes... I am attempting to execute some special actions within an installation project for a standard .Net Windows...
5
by: mlev | last post by:
I want function in one namespace to create instance of class defined in another namespace. (more detailed - I try to make independent "Seralizer" dll, to be used by different application, each...
2
by: =?Utf-8?B?T2xkQnV0U3RpbGxMZWFybmluZw==?= | last post by:
I want create an instance of an object which accepts a Data Reader as a constructor. I realize that I could create a gigantic case statement in which I test for each text name, but that case...
0
by: mkadasi | last post by:
I want to dynamically create instance of class stored in other application. I am writing the following code for this purpose: Here in the AssemblyFunc() I am loading the assembly of TariffClass...
3
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
In the install event, I need to show the user a list of SQL Servers visible to the machine (getting the list is no problem) so the user can multiselect which servers apply. Some other UI stuff as...
1
by: gayane | last post by:
Hi everone I have myobject of type object and i want to create instance of its real type. All types are standart types. From myobject.getType() and can get its type. But how to create instance ?...
1
by: yogita1107 | last post by:
I have a setup project in Visual Studio 2008 with Custom Action class. I have to execute the msi on command line using msiexec /i SetupProject.msi /qb /l* out.txt command. The task is to write custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.