开发者

Visual Studio 2008 Setup Project Install error: "Could not load file or assembly"

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, refere开发者_高级运维nces 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜