installutil.exe installing windows service

I'm tring to install a windows service and keep getting the following message, can anyone help with this? TIA


C:\Program Files\My Application>installUtil.exe MyApp.exe
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Program Files\My Application\MyApp.exe assembly's progress.
The file is located at C:\Program Files\My Application\MyApp.InstallLog.
Installing assembly 'C:\Program Files\My Application\MyApp.exe'.
Affected parameters are:

logtoconsole =
assemblyMyApph = C:\Program Files\My Application\MyApp.exe
logfile = C:\Program Files\My Application\MyApp.InstallLog

An exception occurred while trying to find the installers in the C:\Program Files\My Application\MyApp.exe assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExc
eptions property for more information.
Aborting installation for C:\Program Files\My Application\MyApp.exe.

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to get installer types in the C:\Program Files\My Application\MyApp.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Program Files\My Application\MyApp.exe assembly's progress.
The file is located at C:\Program Files\My Application\MyApp.InstallLog.
Rolling back assembly 'C:\Program Files\My Application\MyApp.exe'.
Affected parameters are:
logtoconsole =
assemblyMyApph = C:\Program Files\My Application\MyApp.exe
logfile = C:\Program Files\My Application\MyApp.InstallLog
An exception occurred while trying to find the installers in the C:\Program Files\My Application\MyApp.exe assembly.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExc
eptions property for more information.
Aborting installation for C:\Program Files\My Application\MyApp.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:\Program Files\My Application\MyApp.exe assembly.
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: Unable to
load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback wil
l 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.

C:\Program Files\My Application>pause:
Press any key to continue . . .

[3425 byte] By [phanf] at [2007-12-18]
# 1
Do you have all of the dependencies for the service in the same folder as the service (or in the GAC) so that they can be discovered. It sounds like you may be missing something.
ShannonBraun at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 2

I'm getting the same error and yes, I have all the dependencies in the same folder as the service. On my VPC development environment and my laptop the install works fine, but when the client tries to install they are getting this error. I have tested it on another laptop that has never been used for development, and I was able to reproduce the error. Any ideas?

Thanks,

Gary

bigrockshow at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 3
Sorry I think I posted in the wrong forum, but if someone can answer, please do. I'm using .Net version 1.1 and Windows Server 2003 & Windows XP.
bigrockshow at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 4

You're running into 'standard user'. I'm guessing that you may be running under an account that is a member of the local admin group, but with Vista UAC enabled even admins run as standard user until they run an application that makes a explicit admin request - at which point you typically get a admin elevation prompt. InstallUtil.exe isn't marked as explicitly requiring admin so this is failing.

Either create a cmd script that runs InstallUtil youService.exe and set the script to require admin or do a 'runas /user:Administrator cmd.exe' and run InstallUtil from there.

TomKirby-Green at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 5

I just ran into the same problem using Visual Studio 2005. An executable that had been installing just fine for months started failing today.

I verified that the installer was showing up in the disassembly and tried everything else I could think of, including rebuilding the application.

Strangely, the install worked only after I rebuilt the entire solution, which includes 20 dlls in addition to the executable.

Weird.

Den

DennisL.Hughes at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 6
I am having the same problem and I know I have all the files I need because the install works on my development laptop and I copied over all the same files. Were you ever able to figure out what was wrong? I need to get this working by Monday so any help would greatly be appreciated!
basic4ever at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 7

My issue was resolved, and installutil was not the problem. We were using Crystal Reports and there were some issues with the merge modules that I was unaware of. One of the other developers at my company is the Crystal expert, so I'm not even sure what he did to get it to work, but I do know that I had to make the merge modules part of the project output, and then it worked. Sorry I couldn't be more help to you.

Gary

bigrockshow at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 8
Yeah I am not using Crystal Reports at all so that wouldn't be my problem. Thanks for replying though. If anyone else can shed some light on this, it be a tremendous help. Thanks so much.
basic4ever at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 9

I'm not using CrystalReports and I am having this problem. I'm practicing writting services for Vista and am cannot install the service. It's a .NET project which is a windows service. When I first tried to debug it I received an error message saying that I had to use installutil.exe and then start the project from net start. I learned about installutil and created an Installer class in my project. When I try to install I run as admin (which I detest), but recieve the error that installutil can't access the EventLog.

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all eve
nt logs could not be searched. Inaccessible logs: Security.

jader3rd at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 10
I found out that the install works when I use the InstallUtil.exe in the 32-bit framework, but generates the System.Reflection.ReflectionTypeLoadException when running the InstallUtil.exe in the 64-bit framework. Is this a setting I need to put in my project or a structure I'm including that is not supported by 64-bit? (although I thought it was backwards compatible).
basic4ever at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 11

I searched my computer for all instances of installutill.exe and found four. Two were under x86 directories and two under x64. The result when using all of them are the same.

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all eve
nt logs could not be searched. Inaccessible logs: Security.

When I did the search two installutill.exe.config.xml's also were found. Would it be possible to modify those to get around this issue?

jader3rd at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 12
I discovered the problem. I wasn't running as Administrator. I didn't know to run cmd with raised privlages that you had to right click and select 'run as Administrator'. I thought running runas from the commandline would elevate the privlages. Once I right clicked and ran cmd as Administrator it worked.
jader3rd at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified