Include Other Referenced DLLs in Build

Dec 1, 2009 at 1:12 AM

I am using the DNN Template you provided to create a new module. In this module I reference various other third party assemblies which need to be included in the final module installation package in the bin folder of course. I am not at all experienced in the inner workings of MSbuild and have been trying to modify the DNNModule.targets file in an attempt to get the additional DLLs to be included in the final build. Could someone please show me how to do it. Thanks in advance!

Dec 1, 2009 at 1:08 PM
Simply open up the DNNModule.targets file and find the following section.
 <!-- Obtain reference to installation files -->
        <CreateItem Include="$(TargetDir)$(CompanyName).$(ModuleName).dll;
Add your dll reference to the end of the list delimited by ;
Now the dnn manifest file (MyModule.dnn) needs to be updated to include your dlls
                <component type="Assembly">
 That should be it.  If you are using the DeployPDB flag then add your dll to that CreateItem as well.

  <CreateItem Include="$(TargetDir)\$(CompanyName).$(ModuleName).pdb;$(TargetDir)\$(CompanyName).$(ModuleName).dll;$(TargetDir)\$3rdPartyDll.dll">
   <Output TaskParameter="Include" ItemName="PDBFile" />

After making those changes, you will need to close and reopen the project.
Dec 1, 2009 at 10:09 PM

Thanks a ton!