Include Other Referenced DLLs in Build

Dec 1, 2009 at 2: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!

Coordinator
Dec 1, 2009 at 2: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;
       $(MSBuildProjectDirectory)\App_LocalResources\*.resx;
       $(MSBuildProjectDirectory)\*.SqlDataProvider;
       $(MSBuildProjectDirectory)\*.ascx;
       $(MSBuildProjectDirectory)\*.css;
       $(MSBuildProjectDirectory)\*.dnn;
       $(MSBuildProjectDirectory)\*.txt;
       $(MSBuildProjectDirectory)\*.gif;
       $(MSBuildProjectDirectory)\*.js;
      $(TargetDir)3rdPartyDll.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">
                    <assemblies>
                        <assembly>
                            <path>bin</path>
                            <name>3rdPartyDll.dll</name>
                        </assembly>
                    </assemblies>
                </component>
 
 
 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" />
  </CreateItem>

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

Thanks a ton!