Problems after customizing Guidance Package

Topics: CAB & Smart Client Software Factory
Aug 30, 2007 at 8:00 AM
Hello,

I tried to customize the Smart Client Factory Guidance Package and ran into a problem.
My goal was that the required dlls (CAB, EntLib, etc.) should be copied into a subfolder of of the Lib folder instead of directly into the Lib folder.

So I altered the file CreateSmartClientFactorySolutionCommon.xml from

...
<Action Name="CreateSolutionDirectory" Type="CreateDirectoryAction"
DirectoryName="Lib">
<Output Name="FullPath"/>
</Action>
...

to

...
<Action Name="CreateSolutionDirectory" Type="CreateDirectoryAction"
DirectoryName="Lib\Application Blocks">
<Output Name="FullPath"/>
</Action>
...

After executing the newly registered package the references to CompositeUI.dll and CompositeUI.WinForms.dll are broken in the Shell project. Strangely the references in the infrastructure projects are ok.

Ciao,
JJ
Developer
Aug 31, 2007 at 12:58 AM
Hi , what you are describing is happening because the recipe is not adding the references to the Shell as it does with the Infrastructure projects.

The recipe has some actions to add the references to the Infrastructure project, for example:
<Action Name="AddCABReferenceToInterface" Type="AddAssemblyReferenceAction" >
      <Input Name="AssemblyFilePath" ActionOutput="CABExpressionAction.ReturnValue"/>
      <Input Name="ReferringProject" RecipeArgument="InterfaceProject"/>
</Action>
<Action Name="AddCABWinFormsReferenceToInterface" Type="AddAssemblyReferenceAction" >
      <Input Name="AssemblyFilePath" ActionOutput="CABWinFormsExpressionAction.ReturnValue"/>
      <Input Name="ReferringProject" RecipeArgument="InterfaceProject"/>
</Action>
In the case of Shell, those references are defined in the Shell.csproj.template file located at the folders Shell.Basic.CS and Shell.Extended.CS in the following way:
<Reference Include="Microsoft.Practices.CompositeUI, Version=1.0.51205.0, Culture=neutral, processorArchitecture=MSIL">
    <SpecificVersion>False</SpecificVersion>
    <HintPath>$(SolutionDir)\Lib\Microsoft.Practices.CompositeUI.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.CompositeUI.WinForms, Version=1.0.51205.0, Culture=neutral, processorArchitecture=MSIL">
    <SpecificVersion>False</SpecificVersion>
    <HintPath>$(SolutionDir)\Lib\Microsoft.Practices.CompositeUI.WinForms.dll</HintPath>
</Reference>
As you may see, the HintPath contains Lib in the path.

You have two ways to solve this:

  • Change the HintPath with the new directory path
  • Modify the recipe to add those references there. (Remember to delete the references of the .csproj file to avoid duplicated references)

BTW – After solve it, remember to register the package.

Please let me know if this helps,

Ezequiel Jadib
http://staff.southworks.net/blogs/ejadib
Sep 1, 2007 at 8:28 PM
Ezequiel,

Many thanks for your reply. The first way you mentioned works. But I will give your second suggestion a try too. This one seems to be the cleaner way.

Ciao,
JJ