Assembly unable to load during windows service installation

I have a windows service created in and I am trying to create a setup project to install it.  When I run the install program I get the following error message:

Unable to get the installer types in the <...> assembly. --> One or more of the types in the assembly unable to load.

Is there any way to find out which assembly is causing the problem.  The install works fine on another machine.  Can anyone suggest why this might be happening.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Christopher KileCommented:
Your assembly module that contains those types is not where you expect it to be.  Check which directory the install thinks it's in, then physically check your system to verify that the assembly is in fact in that location.  If it is, we'll see if we can find something else to check.
nicksbellAuthor Commented:
Well I am not entirely sure I understand what you are saying, my problem (I think) is identifying which 'types' we are talking about.  I have checked all of the dependencies in my setup project and they all point to valid locations for the source that what you meant?
Christopher KileCommented:
Not the source files.  At run-time, your source files are just a bunch of text (these aren't VBScript files, after all).  The types are contained in DLLs and EXEs that must be loaded and referenced at runtime.  We also call these "types" CLASSES.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

nicksbellAuthor Commented:
Sorry, when I said source files, I meant the orginal references to DLLs in the underlying project....not the 'source' as in code files.  What I meant was that the dependencies shown in the setup project relate to the DLLs that are referenced by the primary output project.  The locations of these DLLs are all valid.

Incidentally, the whole solution, including the setup  project compiles without a problem.  The problem arises when I try to run the setup.exe file.
nicksbellAuthor Commented:
I have run msiexec /l*v from the command line and the area in the log file where the error is is as follows:

MSI (s) (C4:54) [11:32:33:230]: Executing op: FileCopy(SourceName=NEMOS_~4.DLL|nemos_RemoteServer.dll,SourceCabKey=_DF1B5F0694AECA3C6EC2506D8E535827,DestName=nemos_RemoteServer.dll,Attributes=512,FileSize=17920,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,Version=1.0.2636.17472,Language=0,InstallMode=58982400,,,,,,,)
MSI (s) (C4:54) [11:32:33:230]: File: C:\Program Files\FundSolve Ltd\AutoCalcSetup\nemos_RemoteServer.dll;      To be installed;      Won't patch;      No existing file
MSI (s) (C4:54) [11:32:33:230]: Source for file '_DF1B5F0694AECA3C6EC2506D8E535827' is compressed
InstallFiles: File: nemos_RemoteServer.dll,  Directory: C:\Program Files\FundSolve Ltd\AutoCalcSetup\,  Size: 17920
MSI (s) (C4:54) [11:32:33:480]: Note: 1: 2318 2: C:\Program Files\FundSolve Ltd\AutoCalcSetup\nemos_RemoteServer.dll
MSI (s) (C4:54) [11:32:33:902]: Executing op: CacheSizeFlush(,)
MSI (s) (C4:54) [11:32:33:902]: Executing op: InstallProtectedFiles(AllowUI=1)
MSI (s) (C4:54) [11:32:33:902]: Executing op: ActionStart(Name=_42B0858D_0656_415E_A005_6AAD464BF28B.commit,,)
Action 11:32:33: _42B0858D_0656_415E_A005_6AAD464BF28B.commit.
MSI (s) (C4:54) [11:32:33:902]: Executing op: CustomActionSchedule(Action=_42B0858D_0656_415E_A005_6AAD464BF28B.commit,ActionType=1537,Source=BinaryData,Target=ManagedInstall,CustomActionData=/installtype=notransaction /action=commit /LogFile= "C:\Program Files\FundSolve Ltd\AutoCalcSetup\nemos_AutoCalcService.exe" "C:\DOCUME~1\ADMINI~1.DAT\LOCALS~1\Temp\CFG51.tmp")
MSI (s) (C4:54) [11:32:33:902]: Executing op: ActionStart(Name=_4B9E3141_0D84_4D5A_BB6F_4E6AA9B0210F.rollback,,)
Action 11:32:33: _4B9E3141_0D84_4D5A_BB6F_4E6AA9B0210F.rollback.
MSI (s) (C4:54) [11:32:33:902]: Executing op: CustomActionSchedule(Action=_4B9E3141_0D84_4D5A_BB6F_4E6AA9B0210F.rollback,ActionType=1281,Source=BinaryData,Target=ManagedInstall,CustomActionData=/installtype=notransaction /action=rollback /LogFile= "C:\Program Files\FundSolve Ltd\AutoCalcSetup\nemos_AutoCalcService.exe" "C:\DOCUME~1\ADMINI~1.DAT\LOCALS~1\Temp\CFG51.tmp")
MSI (s) (C4:54) [11:32:33:902]: Executing op: ActionStart(Name=_97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install,,)
Action 11:32:33: _97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install.
MSI (s) (C4:54) [11:32:33:902]: Executing op: CustomActionSchedule(Action=_97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install,ActionType=1025,Source=BinaryData,Target=ManagedInstall,CustomActionData=/installtype=notransaction /action=install /LogFile= "C:\Program Files\FundSolve Ltd\AutoCalcSetup\nemos_AutoCalcService.exe" "C:\DOCUME~1\ADMINI~1.DAT\LOCALS~1\Temp\CFG51.tmp")
MSI (s) (C4:68) [11:32:33:933]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI2B.tmp, Entrypoint: ManagedInstall
MSI (s) (C4!80) [11:32:34:542]: Note: 1: 2262 2: Error 3: -2147287038
MSI (c) (48:DC) [11:32:34:542]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog,
Error 1001. Unable to get installer types in the c:\program files\fundsolve ltd\autocalcsetup\nemos_autocalcservice.exe assembly. --> One or more of the types in the assembly unable to load.
MSI (s) (C4!80) [11:32:39:308]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C4!80) [11:32:39:308]:
MSI (s) (C4:68) [11:32:39:308]: Leaked MSIHANDLE (26) of type 790531 for thread 4736
MSI (s) (C4:68) [11:32:39:308]: Note: 1: 2769 2: _97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install 3: 1
MSI (s) (C4:68) [11:32:39:308]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2769:  Custom Action _97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _97B9AA6E_40BD_4A59_8184_ED44B8A3820F.install, 1,
Action ended 11:32:39: InstallFinalize. Return value 3.
MSI (s) (C4:54) [11:32:39:323]: User policy value 'DisableRollback' is 0
MSI (s) (C4:54) [11:32:39:323]: Machine policy value 'DisableRollback' is 0
MSI (s) (C4:54) [11:32:39:323]: Executing op: Header(Signature=1397708873,Version=301,Timestamp=913660945,LangId=1033,Platform=0,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=0)
MSI (s) (C4:54) [11:32:39:323]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (C4:54) [11:32:39:323]: Executing op: DialogInfo(Type=1,Argument=AutoCalcSetup)
MSI (s) (C4:54) [11:32:39:323]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
Action 11:32:39: Rollback. Rolling back action:

Does this mean anything to you?  Is it possible to identify what the problem is from this.
Christopher KileCommented:
What this is telling me is that AutoCalcService.Exe has a dialog in it called ErrorDialog that uses an object type of ErrorIcon that is not available in the .EXE.  It could be a bad name, or it could be that ErrorIcon is a resource that is contained in another DLL or EXE that isn't yet installed (it may be getting installed as a later part of the process).

Does any of this ring any bells with you?  I'm assuming you developed the AutoCalcService.EXE and that you know where and what the ErrorDialog is.
nicksbellAuthor Commented:
Unfortunately not.  There is no reference at all to ErrorDialog or ErrorIcon in any of my code.  The strange thing is this install works on 2 other machines without a problem.  I have tried reinstalling both the .Net Framwork as well as Visual Studio in case some assemblies had got corrupted but to no avail.  I'm really stumped.
Christopher KileCommented:
OK, I figured something out with some research.  The ErrorDialog and ErrorIcon errors are spurious, they simply mean that an error occurred.  The real error was in a custom installation step that is being handled by a routine called ManagedInstall.  Two errors occurred, in fact.  I have no idea what they are since it is your custom installation step, but you may want to debug it very carefully on this new machine.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nicksbellAuthor Commented:
So I removed all references from AutoCalcService.exe and commented out the code that relied on those reference and then added them back one by one until I found the reference that was causing the problem.  Once I found the offending reference I commented out all of the code that depended on that reference and reintroduced the code bit by bit until I found the specific piece of code that was causing the problem.

The unfortunate thing is that the offending piece of code compiles without a problem and debugs in the development environment without a problem....its just when I try to install via the installation package that the error occurs.  The other unfortunate thing is that the reference is to a third party DLL so I guess I now need to get on to them to see if they can suggest a reason why.

Anyway, thanks a lot for your help.  You can have the points for trying.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.