Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > conditionally adding a binary reference to a project
 

conditionally adding a binary reference to a project

Hi,

My requirement is as below:

"User should be provided an option to include a binary dll in the project.

Ifthe userselects the checkbox,the dll should be added as reference to the project when project unfolds otherwise not"

As such I have added a recipe argument(UserInputStringValue) to get the user input and based on that value,I tried to add the reference in the project's template file.

Here is the snippet I have added in the cs.proj file:

<Reference Include="SampleTest" Condition=" '$(UserInputStringValue) == 'true' ">
<HintPath>$DependenciesPath$\SampleTest.dll</HintPath>
</Reference>

The problem is when the project unfolds UserInputStringValue is always shown as "".

Could someone help me in this?

Can someone suggest me any other way of doing this?

Your help is highly appreciated.

Thanks in advance,

-Chandra

chandra1729  Thursday, May 08, 2008 8:45 PM
Hi,

what you have to do is unfold the template without that reference, then after the template is unfolded execute an action which will create the project references based on your conditions. To do that you have to define a recipe for the template (i'm guessing that you already did it).

You can download SFT http://www.softwarefactoriestoolkit.net/ and use the AddProjectReferenceAction action which is available in the library.

hth.
jose



Jose Escrich  Friday, May 16, 2008 4:09 PM
Hi,

what you have to do is unfold the template without that reference, then after the template is unfolded execute an action which will create the project references based on your conditions. To do that you have to define a recipe for the template (i'm guessing that you already did it).

You can download SFT http://www.softwarefactoriestoolkit.net/ and use the AddProjectReferenceAction action which is available in the library.

hth.
jose



Jose Escrich  Friday, May 16, 2008 4:09 PM

You can use google to search for other answers

Custom Search

More Threads

• This forum is moving â€?week of 5/27
• When DSL and GAT integration is comming?
• Change the buttontext
• Installing GAT on Vista with Orcas Beta1
• Not able to install on vista x64
• Guidance don´t unload the AppDomain
• The registry hive containing the path information for the EntLib assemblies can not be found. The repository classes can be crea
• How to remove Extra Lines using TextTemplateAction
• Anybody has an idea how to specify a icon file for a recipe. (Please help)
• How to Create Project Reference and App_Code from Web Sevice?