Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create an evaluated Custom Parameter in a VSTemplate
    primarykey
    data
    text
    <p>So I'm modifying a multi-project VS Template (Visual Studio project template), and I want to set a Custom Parameter in the root template to be used by the sub templates. However, I want to set it based on an existing parameter.</p> <p>So, for example, this works fine:</p> <p><code>&lt;CustomParameter Name="$FaultProject$" Value="MyProject.FaultContracts"/&gt;</code></p> <p>The variable $FaultProject$ is replaced by MyProject.FaultContracts, as it should be.</p> <p>This, however, does not work:</p> <p><code>&lt;CustomParameter Name="$FaultProject$" Value="$safeprojectname$.FaultContracts"/&gt;</code></p> <p>I expect $safeprojectname$ to be replaced by the correct value, but it is not. Instead, the variable $FaultProject$ is replaced by $safeprojectname$.FaultContracts. The $safeprojectname$ is interpreted as a literal rather than the parameter that it is.</p> <p>This is in spite of the fact that in the same file, this works exactly as expected:</p> <p><code>&lt;ProjectTemplateLink ProjectName="$safeprojectname$.FaultContracts"&gt;WCFFaultContract\FaultContract.vstemplate&lt;/ProjectTemplateLink&gt;</code></p> <p>Any ideas would be helpful. I believe I might be able to write an IWizard class that would do this, but I'd rather avoid that for such a simple function, if possible.</p> <p>Alternatively, if I can get a parameter that contains the value of the root template's $safeprojectname$, that would address my need as well (in the sub-templates, $safeprojectname$ is changed to the sub-project's name, not the value it had in the root template).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload