You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何自定义TFS DefaultTemplate.xaml,默认设置MSBuildArguments参数

How to Set Default MSBuildArguments in TFS DefaultTemplate.xaml

Let’s get this sorted so you don’t have to manually punch in those MSBuild arguments every time you create a new XAML build definition. Here’s a step-by-step breakdown:

  • Step 1: Grab the DefaultTemplate.xaml file
    Head over to your TFS team project’s Build Process Templates library (usually under Team Project > Builds > Process Templates). Download the DefaultTemplate.xaml to your local machine. Pro tip: make a backup of the original template first—better safe than sorry if something goes sideways.

  • Step 2: Open the template in Visual Studio
    Launch Visual Studio (ensure you have the TFS Build tools installed; they’re included with full VS installations). Open the downloaded DefaultTemplate.xaml file—this will fire up the Workflow Designer.

  • Step 3: Update the MSBuildArguments default value

    1. In the Workflow Designer, open the Arguments panel (find it in the right-hand toolbar, or via View > Other Windows > Arguments).
    2. Scroll through the argument list until you spot MSBuildArguments—it’s usually grouped under the "Advanced" process parameters.
    3. Select MSBuildArguments, then check the Properties window (bottom-right corner of VS). Locate the DefaultValue property.
    4. Set the DefaultValue to exactly this: /p:DebugType=pdbOnly;Configuration=Release
    5. Save your changes to the XAML file.
  • Step 4: Upload the modified template back to TFS
    Return to your TFS team project’s Build Process Templates library. Upload the edited DefaultTemplate.xaml—you can replace the original if you want it to be the new default, or upload it as a separate template if you want to keep the original intact.

  • Step 5: Test it out
    Create a new XAML build definition and select your modified DefaultTemplate.xaml. Navigate to the Advanced settings section—you’ll see MSBuildArguments already populated with your desired value, no manual typing required!

A quick heads-up: If your team uses multiple build templates, double-check that this modified version is set as the default for new build definitions in your TFS project’s build settings.

内容的提问来源于stack exchange,提问作者Dhurva

火山引擎 最新活动