1

I'm having an issue that apparently many people have had as well, only what has worked for others has not yet worked for me. Here is the setup:

VS2008 solution with 5 projects, all targeting .NET 2.0:

  1. DLL A, no project references
  2. DLL B, references DLL A
  3. Windows Forms App, references DLL B
  4. Windows Service, references DLL B
  5. Setup Project

What I want to happen is DLL A and DLL B get installed to the GAC, but I'm getting an error on installation:

Error 1001. Could not load file or assembly 'DLL_B', version 1.0.0.1, Culture=neutral, PublicKeyToken=5e297270603814f4' or one of its dependencies. The system could not find the file specified.

From what I read here and here and a few other sites, I have done the following in no particular order:

  • Re-referenced everything in my projects
  • Added the compiled EXEs manually to the setup project (instead of using 'Primary Output'... DLL A and DLL B came up as 'Detected Dependencies')
  • In the setup project -> Launch Conditions -> set .NET Framework to 2.0
  • In the setup project -> File System -> Requested that detected dependencies be installed to the Global Assembly Cache Folder

So, I'm probably missing something. Can anyone help me figure out what that is?

Thanks ahead of time.

Community
  • 1
  • 1
Honus Wagner
  • 2,830
  • 13
  • 44
  • 61

1 Answers1

1

It sounds like you are using an InstallUtil custom action to install and start your windows service and that this windows service has a dependency that is in the GAC. It's a known limitation of Winodows Installer that files for the WinSXS and GAC aren't installed until the Commit phase which is after your Custom Action is firing ( Deferred Phase )

First you should know that InstallUtil custom actions are very fragile and that there are better ways to do this. Second you'll never be able to get around the problem I described above except to either a) Set the service to Auto and do a reboot or b) not install the assembly to the GAC.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Could you point me in the right direction of some better ways to accomplish what I want to do? – Honus Wagner Apr 08 '11 at 01:53
  • Nice! That was definitely it! I found a GREAT post on Google Groups that I applied the code and it worked out of the box: https://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4d45e9ea5471cba4/4519371a77ed4a74?hl=en&pli=1 – Honus Wagner Apr 08 '11 at 02:27