Question

I have a solution in Visual Studio 2012 containing several Projects. I am trying to add a project to another project as a Reference to be able to use them together, but I cannot figure out why adding this project reference is resulting in a missing DLL when deployed/ran (FusionLog below). I have used this method before without this issue so I must be missing something here...

Solution Configuration:

Main Project: Bootstrapper
Sub Project: BootstrapperCustom
Project I am trying to add as a Reference: LicenseCheck to BootstrapperCustom
Missing DLL when deployed: LicenseCheck.dll

[Bootstrapper]
--Installer: Configuration: N/A, Platform: N/A
--Build: Configuration: Active (Debug), Platform: Active (x86)
--Ref:
----[BootstrapperCustom]

[BootstrapperCustom]
--Application: Configuration: N/A, Platform: N/A, Target framework: .NET 4.5, Output type: Class library
--Build: Configuration: Active (Debug), Platform: Active (Any CPU), Platform target: Any CPU
--Ref:
----[BootstrapperCore] (Copy Local: True)
----[LicenseCheck] (Copy Local: True)
----[Microsoft.Deployment.WindowsInstaller] (Copy Local: True)
----[Microsoft.Practices.Prism] (Copy Local: True)

[LicenseCheck]
--Application: Configuration: N/A, Platform: N/A, Target framework: .NET 4.5, Output type: Class library
--Build: Configuration: Active (Debug), Platform: Active (x86), Platform target: Any CPU
--Ref:
----[Microsoft.Deployment.WindowsInstaller] (Copy Local: True)
----[Parse] (Copy Local: True)

Error message:

Run Bootstrapper.exe = `Could not load file or assembly 'LicenseCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.`

FusionLog (Confirmed LicenseCheck.dll is Missing):

[%TEMP%\{x}\.ba1]
--BootstrapperCore.dll
--BootstrapperCustom.dll
--Microsoft.Practices.Prism.dll

=== Pre-bind state information ===
LOG: User = NOTTHOR\dirt
LOG: DisplayName = LicenseCheck, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Users/dirt/AppData/Local/Temp/{94ef2c32-a419-410e-a8a0-df404f022ff7}/.ba1/
LOG: Initial PrivatePath = NULL
Calling assembly : BootstrapperCustom, Version=1.0.5028.16514, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\dirt\AppData\Local\Temp\{94ef2c32-a419-410e-a8a0-df404f022ff7}\.ba1\BootstrapperCore.config
LOG: Using host configuration file: C:\Users\dirt\AppData\Local\Temp\{94ef2c32-a419-410e-a8a0-df404f022ff7}\.ba1\BootstrapperCore.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/dirt/AppData/Local/Temp/{94ef2c32-a419-410e-a8a0-df404f022ff7}/.ba1/LicenseCheck.DLL.
LOG: Attempting download of new URL file:///C:/Users/dirt/AppData/Local/Temp/{94ef2c32-a419-410e-a8a0-df404f022ff7}/.ba1/LicenseCheck/LicenseCheck.DLL.
LOG: Attempting download of new URL file:///C:/Users/dirt/AppData/Local/Temp/{94ef2c32-a419-410e-a8a0-df404f022ff7}/.ba1/LicenseCheck.EXE.
LOG: Attempting download of new URL file:///C:/Users/dirt/AppData/Local/Temp/{94ef2c32-a419-410e-a8a0-df404f022ff7}/.ba1/LicenseCheck/LicenseCheck.EXE.

Note: When I rebuild the BootstrapperCustom project, I do see LicenseCheck.dll being generated in Bootstrapper\bin\Debug.

Was it helpful?

Solution 2

Turns out this was something in the main project (WiX Bootstrapper) configuration. I failed to include the LicenseCheck.dll in my Payload list for the BootstrapperApplication.

Added to Bootstrapper\Bundle.wxs:

<Payload SourceFile="$(var.BootstrapperCustom.TargetDir)LicenseCheck.dll" />

OTHER TIPS

Did you try to see if the project you're referencing uses the LicenseCheck dll file, but does not actually reference it? (For example: Your referenced project might be loading the dll dynamically during initialization).

If this is the case, you can add a build step to copy the dll to the output folder (see Copying files into the application folder at compile time for example)

In your solution explorer, right click and rebuild that project. See if the dll gets regenerated in windows explorer. To get it working, just copy over the dll from that project to your main projects bin folder. It should work. This is a worst case scenario to just get up and running

I know this isn't your answer, but I came here with the same error message, looking for inspiration to what to look for. It turned out that my referenced project was of a newer target framework than my main project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top