1

Can somebody help me on enumerating a C# project files and update the cs file headers in Visual Studio 2010? Any helpful code snippet or a pointer to that would be highly appreciated.

Anindya Chatterjee
  • 5,824
  • 13
  • 58
  • 82
  • Can you be a little more verbose? Are you looking for a macro that runs inside of Visual Studio when you already have a solution open? Or are you talking about something you would run from the command line? Also, can you give examples of what kind of manipulation you want to perform on the CSPROJ and CS files? – Russell McClure Oct 15 '10 at 20:22
  • I want to develop a VS2010 extension, which will change the header of some cs files from the opened solution. – Anindya Chatterjee Oct 17 '10 at 05:40
  • 1
    "update the cs file headers": C# files don't really have a header. Do you mean something like inserting a license comment at the top of a file? – Dirk Vollmar Nov 18 '10 at 13:25

3 Answers3

1

Try the solution file parser or you could use Visual Studio Extensibility Objects (DTE) by importing the envdte.dll. There is a lot of documentation for this.

Community
  • 1
  • 1
Kell
  • 3,252
  • 20
  • 19
1

Check out the Visual Studio SDK at http://msdn.microsoft.com/en-us/library/bb166441.aspx and checking out the samples.

AMissico
  • 21,470
  • 7
  • 78
  • 106
0
  1. Search for all .csproj files in a folder and it's subfolders using your favorite file manager, (eg. FAR Manager, Total Commander etc.).
  2. To perform search and replace in .cs files you can use S&R plugin for FAR Manager (freeware) or "Advanced Find And Replace" application (shareware, but more powerful).
Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121