3

I'd like to put together some VSTS build / release management extensions in C#, although I can find some generic examples using PowerShell it would be handy to have some examples in C#.

Could anyone point me at a C# VSTS extension example please?

2 Answers 2

2

Regarding build task extension, you can specify the C# application, such as console application:

"execution": {
    //"PowerShell3": {
    //  "target": "Hello.ps1",
    //  "argumentFormat": ""
    //}
    "Process": {
      "target": "..\\ConsoleApplication1.exe",
      "argumentFormat": "$(ConnectedServiceName) $(currentDirectory) $(ApiPortalName)"
    }
  }

However the Task SDK are Typescript and PowerShell, so you can’t use the SDK in your application directly, also the newest schema has removed the extra schema info (check remove extra schema info #308), so NodeJS and PowerShell are the recommended way.

Sign up to request clarification or add additional context in comments.

Comments

2

Look at the source of GitVersion. The authors have wrote a TFS/VSTS task associated with it. The core of the tool is pure C#.

Here's the code of their TFS Task https://github.com/GitTools/GitVersion/tree/master/src/GitVersionTfsTask

Here is the task you'd use inside your builds https://marketplace.visualstudio.com/items?itemName=gittools.gitversion#overview

2 Comments

It looked to me like it was TypeScript at the core of that tool. Can you point me towards the C# part? I can't seem to find it.
It looks like they use the .ts file as a runner to then launch the .net core application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.