Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7584353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:53:59+00:00 2026-05-30T18:53:59+00:00

I am probably missing something basic here as this just doesn’t seem to be

  • 0

I am probably missing something basic here as this just doesn’t seem to be working the way I expect. I am not really a c# guy by day.

I have a tfs 2010 plugin that is watching ticket change events and filtering for the WIT changes to tickets that I want. This is all based on http://geekswithblogs.net/jakob/archive/2010/10/27/devleoping-and-debugging-server-side-event-handlers-in-tfs-2010.aspx

I pull out all the necessary variables in the plugin and I need to pass this to the build engine, which will be actually pushing the build. The thing that is giving me the most grief here is that the parameters are pushed as an xaml string or a “dictionary and serialized it into a string”. Now, there is a library Microsoft.TeamFoundation.Build.Workflow that does some handling of this but it seems to be for .net 4 and the tfs server is running in .net 2 and cannot bind it. That method is discussed in the widely linked http://blogs.msdn.com/b/jpricket/archive/2010/03/25/tfs2010-queuing-a-build-from-code-with-custom-process-parameter-values.aspx but he just uses a method DeserialzeProcessParameters that I don’t have access to.

I am just trying to update a few values and I can do this in a couple lines of powershell so I thought I would be able to address it myself but I am running into trouble.

The default Buildrequest.parameters for the build request looks like the below (w/ the /r/n converted to new lines. It can be parsed as the innerXml of an XmlDocument).

If I have an xml doc like below, how, in c#, can I address and update the values for, say, RestoreDatabase?

<Dictionary x:TypeArguments="x:String, x:Object" xmlns="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
            <mtbwa:BuildSettings x:Key="BuildSettings" ProjectsToBuild="$/EJTest/TFSServerEventHandler/TFSServerEventHandler.sln">
                            <mtbwa:BuildSettings.PlatformConfigurations>
                                            <mtbwa:PlatformConfigurationList Capacity="0" />
                            </mtbwa:BuildSettings.PlatformConfigurations>
            </mtbwa:BuildSettings>
            <mtbwa:TestSpecList x:Key="TestSpecs" Capacity="0" />
            <mtbwa:CodeAnalysisOption x:Key="RunCodeAnalysis">Never</mtbwa:CodeAnalysisOption>
            <x:Boolean x:Key="AssociateChangesetsAndWorkItems">False</x:Boolean>
            <x:Boolean x:Key="CreateWorkItem">False</x:Boolean>
            <x:Boolean x:Key="DropBuild">False</x:Boolean>
            <x:Boolean x:Key="PerformTestImpactAnalysis">False</x:Boolean>
            <x:Boolean x:Key="CreateLabel">False</x:Boolean>
            <x:Boolean x:Key="DisableTests">True</x:Boolean>
            <mtbw:BuildVerbosity x:Key="Verbosity">Detailed</mtbw:BuildVerbosity>
            <x:String x:Key="BuildNumber">4.4.2.29</x:String>
            <x:String x:Key="BackupDatabase">yes</x:String>
            <x:String x:Key="RestoreDatabase">Yes</x:String>
            <x:String x:Key="OverwriteBackup">Yes</x:String>
            <x:String x:Key="UpgradeSoftware">No</x:String>
            <x:String x:Key="DeploymentTicket">654</x:String>
</Dictionary>

The x:string values are the ones I want to update and change.

For what it’s worth, the PS version

[xml]$a = Get-Content .\test.xml
$b = $a.Dictionary.string | where {$_.key -eq "CustomerData"}
$b."#text" = 'No'

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:54:01+00:00Added an answer on May 30, 2026 at 6:54 pm

    ok, i banged my way through it. not sure it is the most efficient way but it seems to work:

            XmlDocument xDoc = new XmlDocument();
            xDoc.Load("test.xml");
            XmlNodeList elemList = xDoc.GetElementsByTagName("x:String");
    
            foreach (XmlNode xNode in elemList)
            {
                switch (xNode.Attributes[0].Value)
                {
                    case "BuildNumber":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
                    case "BackupDatabase":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
                    case "RestoreDatabase":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
                    case "OverwriteBackup":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
                    case "UpgradeSoftware":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
                    case "DeploymentTicket":
                        Console.WriteLine(xNode.Attributes[0].Value + " = " + xNode.InnerText);
                        xNode.InnerText = "4.3w2432.2";
                        break;
    
    
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm probably missing something pretty basic here, but if the n-body problem yields chaotic
I know I am probably missing something pretty basic here, but I am trying
I'm probably missing something really obvious. I've included <MediaPlayer/MediaPlayer.h> and have this code: NSURL
I appreciate I'm probably missing something basic here, but... My iPad app will only
Really basic (and probably quite idiotic) question but I'm not familiar with this procedure
I'm probably missing something very basic but I cannot figure out why I get
Probably missing something completely obvious here, but here goes. I'm starting out with Spring
I'm probably missing something very obvious here. I have files with the extension .st
I'm probably missing something simple here, but I can't find the answer elsewhere. I
I'm probably missing something obvious here but here's what I'm trying to do. From

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.