-3

I've been tasked with finding a way to analyze a solution for certain conditions and generate a report with those conditions. This must be done in VS2015 and TFS.

I've already written VS packages so that part is not a problem, but all the tutorials and documents on extending TFS that I've found work with VSTS and simply add something via JavaScript, which is insufficient for what we need.

Is there any way to write a TFS extension in C#? The idea is that the user clicks, let's say, a link in the Code tab of the project in the TFS interface and the extension does something with the code and generates an HTML report.

EDIT: The extension I have to build must analyze specific files in the solution, looking for known patterns, and report their existence. Something like:

+------------+-----------+------------------------------------------+
|File        |Line       |Condition                                 |
+------------+-----------+------------------------------------------+
|Web.config  |225        |Invalid value for key "DISCTOS"           |
|Web.config  |314        |Path in element "TNS_ADMIN" does not exist|
+------------+-----------+------------------------------------------+
Léster
  • 1,177
  • 1
  • 17
  • 39
  • 1
    To answer the exact question you asked, no. Extensions are written in JavaScript. You say that's insufficient, but you don't explain exactly what it is you're trying to do or how the extension API is insufficient, so no one can help you beyond a flat "no" answer. – Daniel Mann Dec 05 '17 at 15:45
  • Edited my post in order to specify what exactly I'm looking for. – Léster Dec 05 '17 at 18:18
  • 1
    A TFS extension can do anything. You can throw executables into it and execute them. That's all the power you need to do anything. Sounds like you just need to read the documentation and start implementing rather than asking an overly broad question on Stack Overflow. – mason Dec 05 '17 at 18:25
  • @mason except nowhere in the documentation says that you can bundle an executable with your extension, or how to run it, or how to capture execution output. And Google failed me in that regard, I did my work before asking. Either I'm really blind or that particular piece of info is very well hidden. – Léster Dec 06 '17 at 12:54
  • I don't think you did your work. You would have found the [extension samples](https://github.com/Microsoft/vsts-tasks). And you'd see that an extension is merely a collection of files with a manifest, very similar to a zip file. You can put anything in it, and tell it what scripts or executables to run. – mason Dec 06 '17 at 13:59

1 Answers1

1

Extension was introduced since Team Foundation Server 2015 Update 2, there is no C# based extension now. You could start from Extensions overview to Write your first extension, and get lots extension samples from website below:

https://learn.microsoft.com/en-us/vsts/extend/develop/samples-overview

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39