• Blog
  • Info Support
  • Career
  • Training
  • International Group
  • Info Support
  • Blog
  • Career
  • Training
  • International Group
  • Search
logo InfoSupport
  • Latest blogs
  • Popular blogs
  • Experts
      • All
      • Bloggers
      • Speakers
  • Meet us
  • About us
    • nl
    • en
    • .NET
    • 3D printing
    • Advanced Analytics
    • Agile
    • Akka
    • Alexa
    • Algorithms
    • Api's
    • Architectuur
    • Artificial Intelligence
    • ATDD
    • Augmented Reality
    • AWS
    • Azure
    • Big Data
    • Blockchain
    • Business Intelligence
    • Chatbots
    • Cloud
    • Code Combat
    • Cognitive Services
    • Communicatie
    • Containers
    • Continuous Delivery
    • CQRS
    • Cyber Security
    • Dapr
    • Data
    • Data & Analystics
    • Data Science
    • Data Warehousing
    • Databricks
    • DataOps
    • Developers life
    • DevOps
    • Digital Days
    • Digital Twin
    • Docker
    • eHealth
    • Enterprise Architecture
    • Event Sourcing
    • Hacking
    • Infrastructure & Hosting
    • Innovatie
    • Integration
    • Internet of Things
    • Java
    • Machine Learning
    • Microservices
    • Microsoft
    • Microsoft Bot Framework
    • Microsoft Data Platform
    • Mobile Development
    • Mutation Testing
    • Open source
    • Pepper
    • Power BI
    • Privacy & Ethiek
    • Python
    • Quality Assistance & Test
    • Quality Assurance & Test
    • Requirements Management
    • Scala
    • Scratch
    • Security
    • SharePoint
    • Software Architecture
    • Software development
    • Software Factory
    • SQL Server
    • SSL
    • Start-up
    • Startup thinking
    • Stryker
    • Test Quality
    • Testing
    • TLS
    • TypeScript
    • Various
    • Web Development
    • Web-scale IT
    • Xamarin
    • All
    • Bloggers
    • Speakers
Home » Team System caches RegistrationEntries client side.
  • Team System caches RegistrationEntries client side.

    • By Patrick Gilhuijs
    • .NET 16 years ago
    • .NET 0 comments
    • .NET .NET
    Team System caches RegistrationEntries client side.

    For about two months I have been working on an adapter that reads data from a source database and uploads it to custom dimensions in the TfsWarehouse. Yesterday I ran into a strange (at least, at that moment) problem. First I’ll explain the situation.

    In the adapter I have a piece of code that queries the RegistrationEntries from the TfsIntegration database using the IRegistration service. The RegistrationEntry contains the database name of my source database and the database server name. I added the RegistrationEntry using the tfsreg.exe tool, providing an xml file with the data to store. An example of such an xml file is provided below. 


    xml version=“1.0“ encoding=“utf-8“ ?>

    <
    RegistrationEntries>
    &nbsp; <
    RegistrationEntry>
    &nbsp;&nbsp;&nbsp; <
    Type>MyEntryType<Type>
    &nbsp;&nbsp;&nbsp; <
    ChangeType>Add<ChangeType>
    &nbsp;&nbsp;&nbsp; <
    Databases>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
    Database>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
    Name>MyDB<Name>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
    DatabaseName>MyDbName<DatabaseName>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
    SQLServerName>MyDBServer<SQLServerName>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <
    ConnectionString>Server=@SQLServerName@;Database=@DatabaseName@;Integrated Security=SSPI<ConnectionString>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <Database>
    &nbsp;&nbsp;&nbsp; <Databases>
    &nbsp; <RegistrationEntry>
    >


    If you want&nbsp;access this information from code you do can something like this:


    TeamFoundationServer server = TeamFoundationServerFactory.GetServer(“http://mytfs:8080“);

    RegistrationEntry[] entries = ((IRegistration)server.GetService(typeof(IRegistration))).GetRegistrationEntries(“MyEntryType”);
    RegistrationEntry entry = entries[0];

    Console.Write(RegistrationUtilities.GetConnectionString(entry, “MyDB”));


    The RegistrationUtilities class replaces the @SQLSevername@ and @DatabaseName@ by the corresponding elements of the RegistrationEntry and creates the ConnectionString for you.
    If you just need to access the database name or the server name you can do that like this:


    string databaseName = entry.Databases[0].DatabaseName;&nbsp;&nbsp; //using index 0 assuming that there’s just one database
    string serverName = entry.Databases[0].SQLServerName;&nbsp;&nbsp;&nbsp; //to keep the example simple
    string name = entry.Databases[0].Name;


    Well, this&nbsp;should help you getting it to work if you&nbsp;would want to.&nbsp;Let’s get on to&nbsp;my problem now.
    I used the tfsreg.exe tool again to update the setting&nbsp;to point to another database. Unfortunately the setting didn’t change when I tried to access it from code.&nbsp;Thinking the setting is cached by tfs I thought that an iisreset would do the thing….Not! Then I started&nbsp;thinking and searching for a&nbsp;location and&nbsp;file where tfs could store this information&nbsp;client side. It turned out that different kinds of settings and information&nbsp;is stored (per user) in different files in this folder:
    C:Documents and Settings<user name>Local SettingsApplication DataMicrosoftTeam Foundation1.0Cache


    On my machine it contains&nbsp;two files: ServerMap.xml, VersionControl.config and folder&nbsp;with a name like _http. The ServerMap.xml contains key/value entries&nbsp;for a service (e.g. http://mytfs:8080/Services/v1.0/Registration.asmx) and the instance id.
    The VersionControl.config contains some info about workspaces etc.


    Most important in my case was the file RegProxyFileCache.xml in the _http folder. It contains all the RegistrationEntries from the TfsIntegration database. So that’s the place where it gets the information from. I didn’t figure out what the cache-time out is. If you run into this problem also, delete the file and you’ll get the updated RegistrationEntry.


    Hope this helps!

    Share this

Patrick Gilhuijs

View profile

Related IT training

Go to training website

Related Consultancy solutions

Go to infosupport.com

Related blogs

  • Building a custom Kubernetes operator in C#

    Building a custom Kubernetes operator in C# Willem Meints - 3 weeks ago

  • Transform SpecFlow Table Column

    Transform SpecFlow Table Column Ronald Bosma - 3 months ago

  • Building a passwordless login flow with WebAuthn and th…

    Building a passwordless login flow with WebAuthn and th… Willem Meints - 5 months ago

Data Discovery Channel

  • Modern Data Platform

  • Gartner Data & Analytics Summit 2022

  • De Data Architecture ®Evolution

Nieuwsbrief

* verplichte velden

Contact

  • Head office NL
  • Kruisboog 42
  • 3905 TG Veenendaal
  • T +31 318 552020
  • Call
  • Mail
  • Directions
  • Head office BE
  • Generaal De Wittelaan 17
  • bus 30 2800 Mechelen
  • T +32 15 286370
  • Call
  • Mail
  • Directions

Follow us

  • Twitter
  • Facebook
  • Linkedin
  • Youtube

Newsletter

Sign in

Extra

  • Media Library
  • Disclaimer
  • Algemene voorwaarden
  • ISHBS Webmail
  • Extranet
Beheer cookie toestemming
Deze website maakt gebruik van Functionele en Analytische cookies voor website optimalisatie en statistieken.
Functioneel Always active
De technische opslag of toegang is strikt noodzakelijk voor het legitieme doel het gebruik mogelijk te maken van een specifieke dienst waarom de abonnee of gebruiker uitdrukkelijk heeft gevraagd, of met als enig doel de uitvoering van de transmissie van een communicatie over een elektronisch communicatienetwerk.
Voorkeuren
De technische opslag of toegang is noodzakelijk voor het legitieme doel voorkeuren op te slaan die niet door de abonnee of gebruiker zijn aangevraagd.
Statistieken
De technische opslag of toegang die uitsluitend voor statistische doeleinden wordt gebruikt. De technische opslag of toegang die uitsluitend wordt gebruikt voor anonieme statistische doeleinden. Zonder dagvaarding, vrijwillige naleving door uw Internet Service Provider, of aanvullende gegevens van een derde partij, kan informatie die alleen voor dit doel wordt opgeslagen of opgehaald gewoonlijk niet worden gebruikt om je te identificeren.
Marketing
De technische opslag of toegang is nodig om gebruikersprofielen op te stellen voor het verzenden van reclame, of om de gebruiker op een website of over verschillende websites te volgen voor soortgelijke marketingdoeleinden.
Manage options Manage services Manage vendors Read more about these purposes
Voorkeuren
{title} {title} {title}