Enterprise Library and Setup projects / missing references

Topics: Exception Handling Application Block, Logging Application Block
Aug 20, 2012 at 1:39 PM


I have 3 projects:





The project Test.WcfService defines a WCF service which is exposed via net.tcp binding. This project is using logging exception handler as part of WCF exception shielding. The reference to Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll was added via NuGet (the logging functionality was not working without this DLL). The project Test.WinService wraps the WCF service within a windows service. The Test.Setup project creates a deployable package of the windows service so that it can be installed on a different machine.

The problem I have is that the dll library Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll is not a detected dependency within the Test.Setup project (as it is not referenced anywhere in the code, only enterprise library configuration file references this assembly) and thus it's not deployed to the machine where the windows service is installed and I'm unable to do logging. Is there a possibility how the setup project would recognize the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll as a required dependency and automatically include this within the deployment setup project package?


Aug 21, 2012 at 2:36 AM

I think you should be able to manually add the assembly to the setup project.

Or you can use the old trick of referencing a type from the target assembly just to create a hard dependency.  For example in the service add something like:

Type dummyDependency = typeof(Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler);

Randy Levy
Enterprise Library support engineer

Aug 22, 2012 at 6:01 AM

Thanks Randy,

I've had added the assembly manually to the Test.WinService project (everything worked fine with that). I was just thinking of another "clearer" way to do this.


Thanks for your help and support ...