1

Is there a reasonable way to generate a complete list of all controllers/actions in a project, along with their various attributes - notably action filters?

Our project is relatively small now, but as it grows we'd like to be able to generate a comprehensive list of all controllers/actions and their [Authorize] settings to make sure that the developers haven't missed anything, and exhaustively searching the source code isn't a viable option.

Kras
  • 623
  • 2
  • 9
  • 13
  • Are you looking at something like using reflection for anything that inherits from a Controller base, then enumerating the methods? – Kane Sep 16 '11 at 11:43
  • Something along those lines, but I wasn't sure how to find/enumerate all controllers/ – Kras Sep 17 '11 at 21:33
  • Actually, what I'd **really** like is an out-of-the-box solution - some VS extension that you just clicked a button and it produced a full set of documentation for your project - comments that developers entered, a comprehensive list of controllers/actions and their attributes, models and their data annotations, etc., etc. – Kras Sep 17 '11 at 21:40
  • Try using Sandcastle or NDoc, it can generate MSDN style documentation from code. – Kane Sep 17 '11 at 23:44

1 Answers1

0

I know this might seem elementary, but how about keeping documentation on the project, or is there another reason for not taking this approach? A Detailed Design Specification and a Functional Requirements Specification would cover those needs. These should be maintained by the softare engineer pre and post code deployment.

-------EDIT-------

Found a similar post here

Community
  • 1
  • 1
bdparrish
  • 3,216
  • 3
  • 37
  • 58
  • We already have those types of documents. My issue here was how to insure that the developers actually **followed** those specs. People make mistakes and it's very easy for the code to get out of sync with the specs (since specs tend to get "stale" once the project really gets going). – Kras Sep 17 '11 at 21:36
  • Look at [this](http://stackoverflow.com/questions/1880388/asp-net-mvc-get-all-controllers) for your answer. – bdparrish Sep 18 '11 at 12:46