473,372 Members | 1,011 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,372 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 12719
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.