Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Deploy referenced assemblies with a guidance package
 

Deploy referenced assemblies with a guidance package

Hi,

My guidance package contains a project which is dependent on some other assemblies. These assemblies are not projects in the guidance package. So, what I want is to contain some sort of reference folder with the required assemblies into the guidance package. Right now, I added the referenced assemblies as project items into the vstemplate of the project, like this:

<Project File="MyProject.csproj" TargetFileName="$UserDefinedProjectName$.csproj" ReplaceParameters="true">

<ProjectItem TargetFileName="Bin\Debug\ReferencedAssembly.dll">Bin\ReferencedAssembly.dll</ProjectItem>

...

<Project>

This doesn't work, the referenced assembly isn't available in the bin\debug folder of a project created with the guidance package.

The referenced assemblies aren't necessarily available on the user's system, so I can't point to a certain location. I don't know if the assembly is already there. Therefore, I'm looking for some way to contain the referenced assemblies into the guidance package and put them in the right place.

Can anybody help me out?

Greets,

Nils Gruson

ngruson  Thursday, February 21, 2008 3:02 PM
Hi Nils,

Adding DLLs to your project as project items just for the sake of being able to reference them later is not a good approach.
These dependant assemblies really belong to the setup for your guidance package.

So when you're writing the Setup for your guidance package (either extending the VS Setup generated by GAT or by writing your own from scratch using WiX -this will give you much more flexibility-) you should plan the file structure on disk of where your guidance package and supporting files will be deployed to. Usually this means copying the DLL with the guidance package itself into a private path (usually C:\Program Files\YourCompanyName\YourProductName) and copying the depedant DLLs in there too. Other alternative is to use the usual "Lib" folder or such where usually binary dependencies are dropped to. You can then easily include references to these DLLs from your guidance package or the projects generated by them (by using proper paths in the project templates).

HTH,
-Victor.

vga  Friday, February 22, 2008 12:33 AM
Hi Nils,

Adding DLLs to your project as project items just for the sake of being able to reference them later is not a good approach.
These dependant assemblies really belong to the setup for your guidance package.

So when you're writing the Setup for your guidance package (either extending the VS Setup generated by GAT or by writing your own from scratch using WiX -this will give you much more flexibility-) you should plan the file structure on disk of where your guidance package and supporting files will be deployed to. Usually this means copying the DLL with the guidance package itself into a private path (usually C:\Program Files\YourCompanyName\YourProductName) and copying the depedant DLLs in there too. Other alternative is to use the usual "Lib" folder or such where usually binary dependencies are dropped to. You can then easily include references to these DLLs from your guidance package or the projects generated by them (by using proper paths in the project templates).

HTH,
-Victor.

vga  Friday, February 22, 2008 12:33 AM

Hi Victor,

The referenced assemblies are now deployed with the setup of the guidance package. The user can install the guidance package wherever he likes, so I have to set the hintpath of the referenced assemblyin the project fileto the directory where the guidance package was installed. I made an argument GuidancePackageInstallPath, it has to be set with the path where the user installed the guidance package.

<ItemGroup>

<Reference Include="ReferencedAssembly">

<SpecificVersion>False</SpecificVersion>

<HintPath>$GuidancePackageInstallPath$\ReferencedAssembly.dll</HintPath>

</Reference>

</ItemGroup>

How can I detect where the guidance package was installed?

Greets,

Nils

ngruson  Friday, February 22, 2008 12:36 PM

You can use google to search for other answers

Custom Search

More Threads

• Guidance actions are gone
• Automated Testing
• how to specify another project within a same solution included as namespace & its objects name used as parameters
• exception in execution of recipe
• a strange problem when we use Automation Toolkit
• Action Condition
• Error while displaying the Current Project name in a Text box of a Custom Wizard Page
• Adding a Custom Reference to Infrastructure.Layout and Infrastruction.Shell
• Add files in multiple projects
• SCSF April 2008 - WPF Resource Dictionary implementation