Giter Site home page Giter Site logo

microsoft / getvstsbuildusage Goto Github PK

View Code? Open in Web Editor NEW
13.0 36.0 19.0 10 KB

This is a code sample to show how to get information about builds run under a Visual Studio Team Services (VSTS) account or a collection on a Team Foundation Server (TFS).

License: MIT License

C# 100.00%

getvstsbuildusage's Introduction

GetVSTSBuildUsage

This is a code sample to show how to get information about builds run under a Visual Studio Team Services (VSTS) account or TFS collection.

Example usage: GetVSTSBuildUsage.exe [Path to VSTS Account or TFS collection] [Minimum Build Finish Date] [Maximum Build Finish Date]

An example when calling VSTS to get the build usage for a month:

GetVSTSBuildUsage.exe https://myaccount.visualstudio.com/defaultcollection 1/1/2016 1/31/2016

getvstsbuildusage's People

Contributors

msftgits avatar scotkelly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

getvstsbuildusage's Issues

MissingMethodException

Hi,

GetBuildsAsync method call throws MissingMethodException. What can i do to solve that problem? Using nuget package: Microsoft.TeamFoundationServer.ExtendedClient.14.102.0
Thanks.

Source Code:
internal static List<Microsoft.TeamFoundation.Build.WebApi.Build> GetBuildDefinitions() { Uri uri = new Uri("<on-premise tfs uri>"); var buildClient = new BuildHttpClient(uri, new VssAadCredential()); VssConnection connection = new VssConnection(uri, new VssAadCredential()); var projectClient = connection.GetClient<ProjectHttpClient>(); var projects = projectClient.GetProjects().Result; buildClient = connection.GetClient<BuildHttpClient>(); var definitions = buildClient.GetBuildsAsync(project: "TfxTarget"); return definitions.Result; }

System.MissingMethodException was unhandled
HResult=-2146233069
Message=Method not found: 'System.Threading.Tasks.Task1<!!0> Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(System.Net.Http.HttpMethod, System.Guid, System.Object, Microsoft.VisualStudio.Services.WebApi.ApiResourceVersion, System.Net.Http.HttpContent, System.Collections.Generic.IEnumerable1<System.Collections.Generic.KeyValuePair2<System.String,System.String>>, System.Object, System.Threading.CancellationToken)'. Source=Microsoft.TeamFoundation.Build2.WebApi StackTrace: at Microsoft.TeamFoundation.Build.WebApi.BuildHttpClientBase.GetBuildsAsync(String project, IEnumerable1 definitions, IEnumerable1 queues, String buildNumber, Nullable1 minFinishTime, Nullable1 maxFinishTime, String requestedFor, Nullable1 reasonFilter, Nullable1 statusFilter, Nullable1 resultFilter, IEnumerable1 tagFilters, IEnumerable1 properties, Nullable1 type, Nullable1 top, String continuationToken, Nullable1 maxBuildsPerDefinition, Nullable1 deletedFilter, Nullable`1 queryOrder, String branchName, Object userState, CancellationToken cancellationToken)
at ConsoleApplication5.Program.GetBuildDefinitions() in c:\Users\uc005129\Documents\Visual Studio 2013\Projects\ConsoleApplication5\ConsoleApplication5\Program.cs:line 28
at ConsoleApplication5.Program.Main(String[] args) in c:\Users\uc005129\Documents\Visual Studio 2013\Projects\ConsoleApplication5\ConsoleApplication5\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

packages.config:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" /> <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.13.5" targetFramework="net451" /> <package id="Microsoft.TeamFoundationServer.Client" version="14.102.0" targetFramework="net451" /> <package id="Microsoft.TeamFoundationServer.ExtendedClient" version="14.102.0" targetFramework="net451" /> <package id="Microsoft.VisualStudio.Services.Client" version="14.102.0" targetFramework="net451" /> <package id="Microsoft.VisualStudio.Services.InteractiveClient" version="14.102.0" targetFramework="net451" /> <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" /> <package id="System.IdentityModel.Tokens.Jwt" version="4.0.0" targetFramework="net451" /> <package id="WindowsAzure.ServiceBus" version="3.4.0" targetFramework="net451" /> </packages>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.