Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Microsoft.Testing.Platform ondersteunt het gebruik van configuratiebestanden en omgevingsvariabelen om het gedrag van het testplatform te configureren. In dit artikel worden de configuratie-instellingen beschreven die u kunt gebruiken om het testplatform te configureren.
testconfig.json
Het testplatform maakt gebruik van een configuratiebestand met de naam [appname].testconfig.json om het gedrag van het testplatform te configureren. Het testconfig.json-bestand is een JSON-bestand dat configuratie-instellingen voor het testplatform bevat.
Het bestand testconfig.json heeft de volgende structuur:
{
"platformOptions": {
"config-property-name1": "config-value1",
"config-property-name2": "config-value2"
}
}
Het platform detecteert en laadt automatisch het [appname].testconfig.json bestand in de uitvoermap van het testproject (dicht bij het uitvoerbare bestand).
Wanneer u Microsoft.Testing.Platform.MSBuildgebruikt, kunt u gewoon een testconfig.json bestand maken dat automatisch wordt gewijzigd in [appname].testconfig.json en naar de uitvoermap van het testproject wordt verplaatst.
Vanaf Microsoft.Testing.Platform 1.5 kunt u het opdrachtregelargument --config-file
gebruiken om het pad naar de testconfig.jsonop te geven. Dit bestand heeft voorrang op het bestand [appname].testconfig.json.
Notitie
Het [appname].testconfig.json bestand wordt overschreven op volgende builds.
Omgevingsvariabelen
Omgevingsvariabelen kunnen worden gebruikt om bepaalde runtimeconfiguratiegegevens op te geven.
Notitie
Omgevingsvariabelen hebben voorrang op configuratie-instellingen in het testconfig.json-bestand.
omgevingsvariabele TESTINGPLATFORM_UI_LANGUAGE
Vanaf Microsoft.Testing.Platform 1.5 stelt deze omgevingsvariabele de taal van het platform in voor het weergeven van berichten en logboeken met behulp van een landinstellingswaarde zoals en-us
. Deze taal heeft voorrang op de talen van Visual Studio en .NET SDK. De ondersteunde waarden zijn hetzelfde als voor Visual Studio. Zie de sectie over het wijzigen van de taal van het installatieprogramma in de documentatie voor de installatie van Visual Studiovoor meer informatie.