Skip to main content

 none
installutil.exe installing windows service RRS feed

  • Question

  • 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 . . .

    Wednesday, January 18, 2006 5:05 PM

All replies

  • 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.
    • Proposed as answer by BRIGHT SIAW Tuesday, February 10, 2009 3:52 PM
    Thursday, January 19, 2006 4:21 AM
  • 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

    Monday, October 23, 2006 4:27 PM
  • 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.
    Monday, October 23, 2006 4:30 PM
  • 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.

     

    Thursday, November 23, 2006 3:29 PM
  • 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

     

    Monday, January 29, 2007 11:51 PM
  • 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!
    Saturday, February 3, 2007 1:45 PM
  • 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

    Monday, February 5, 2007 5:01 PM
  • 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.
    Monday, February 5, 2007 6:12 PM
  • 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.

    Tuesday, February 6, 2007 7:24 AM
  • 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).
    Tuesday, February 6, 2007 2:13 PM
  • 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?

    Wednesday, February 7, 2007 6:16 AM
  • 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.
    Thursday, February 8, 2007 5:32 AM
  • Hi All,

    I have also faced the same problem and struggled for 1 day by searching google and some pages to check on the possible solution...but the solution is not really clear..So, here I would like to share how I came across the problem and manage to find the solution..;)

    Hope this information will be helpful for others.

    Environment: Win2000 Server

    Application : It's a C#.NET , application type Windows Service

    Background: The application is running on Win 2000 Server ~5 years. I was trying to setup on a new Win 2000 Server, it failed during registering as a Service.Below is the logfile during InstallUtil command. [Note: InstallUtil can be retrieved from C:\WINNT\Microsoft.NET\Framework\v2.0.50727\]

    Running a transacted installation.

    Beginning the Install phase of the installation.
    See the contents of the log file for the D:\Programs\MyApp\MyApp.exe
    assembly's progress.
    The file is located at D:\Programs\MyApp\MyApp.InstallLog.
    Installing assembly 'D:\Programs\MyApp\MyApp.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = D:\Programs\MyApp\MyApp.exe
       logfile = D:\Programs\MyApp\MyApp.InstallLog
    An exception occurred while trying to find the installers in the D:\Programs\MyApp\MyApp.exe assembly.
    System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the
     requested types. Retrieve the LoaderExceptions property for more information.
    Aborting installation for D:\Programs\MyApp\MyApp.exe.

    An exception occurred during the Install phase.
    System.InvalidOperationException: Unable to get installer types in the D:\Programs\MyApp\MyApp.exe assembly.
       at System.Configuration.Install.AssemblyInstaller.InitializeFromAssembly()
       at System.Configuration.Install.AssemblyInstaller.Install(IDictionary savedSt
    ate)
       at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
       at System.Configuration.Install.TransactedInstaller.Install(IDictionary saved
    State)
    The inner exception System.Reflection.ReflectionTypeLoadException was thrown wit
    h the following error message: Unable to load one or more of the requested types
    . Retrieve the LoaderExceptions property for more information..
       at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
       at System.Reflection.Module.GetTypes()
       at System.Configuration.Install.AssemblyInstaller.GetInstallerTypes(Assembly
    assem)
       at System.Configuration.Install.AssemblyInstaller.InitializeFromAssembly()

    The Rollback phase of the installation is beginning.
    See the contents of the log file for the D:\Programs\MyApp\MyApp.exe
    assembly's progress.
    The file is located at D:\Programs\MyApp\MyApp.InstallLog.
    Rolling back assembly 'D:\Programs\MyApp\MyApp.exe'.

    Steps: After going thru afew webpages for similar problem..1 of the similarities for my case was "DEPENDENCIES".

    1) If you have a previous Win 2000 Server where the service was able to install, then it's easier.

    2) What you need to do is just use DependecyWalter.NET to find out what are the files the "running" system required for your application

    3) You just need to cross check all of the dependency available at the new Win 2000 Server you are trying to setup.

    4) When I got the dependency, I register it in GAC(Global Assembly Cache) and run the InstallUtil again -> "PROBLEM SOLVED" :D

    What I can advise here is look for the dependencies...as the "shared/existing" Win 2000 Server previously have all the dependencies already registered in the GAC, and after long time to setup on the new Win 2000 Server, usually we forget about the dependencies..;)

     

    WIsh all you guys good luck to solve the same problem and home the explaination above will help you..:)

     

    Rgds,

    SavinderKaur

     

    Friday, March 26, 2010 1:05 AM
  • For those that are using Windows 7, you can simply open an Administrator CMD prompt and run the InstallUtil. 

    • Proposed as answer by DS3 Wednesday, April 18, 2012 12:40 PM
    • Unproposed as answer by DS3 Wednesday, April 18, 2012 12:40 PM
    • Proposed as answer by DS3 Wednesday, April 18, 2012 12:40 PM
    Wednesday, June 9, 2010 1:05 PM
  • You rock.  I can't say how often the runas admin as got me and it did it again! Thaks for pointing out what I should have known, it fixed my issue on installing.
    Tuesday, May 10, 2011 1:56 PM
  • Thanks buddy even i had the same problem after going through this forums i was able to solve my problem thanks a lot...........

    Saturday, May 12, 2012 4:54 PM
  • Question is how we can Run our command prompt as administrator Thanks!

    Alert

    Tuesday, May 6, 2014 9:34 AM
  • Question is how we can Run our command prompt as administrator Thanks!

    Alert

    Tuesday, May 6, 2014 9:34 AM
  • Start -> Programs -> Accessories -> CMD Prompt -> RightClick and select "Run As Administrator"
    Friday, May 9, 2014 1:36 PM
  • This was exactly my problem, one of the DLL didn't have checked the "Copy local" option, and it worked when I executed the service, but I couldn't install the service until I found the problem.
    Monday, November 23, 2015 5:34 PM