3

I am trying to create a Visual Studio Extension (either Add-In or VSPackage) that will do the following:

1) Find all selected projects in the current solution. 2) Obtain access to each project's app.config or web.config file and modify it.

I have been able to figure out step 1 for both an Add-In and a VSPackage. I haven't managed to figure out a way to do step 2). Does anyone have pointers to a blog / documentation that can help me complete step 2) ?

Also, which extensibility option would you recommend for such a project? An Add-In or a VSPackage?

Thanks,

armahg

Mihai Limbășan
  • 64,368
  • 4
  • 48
  • 59
armahg
  • 739
  • 2
  • 10
  • 11

1 Answers1

3

Since you have the selected projects, why just don't check if project directory has web.config/app.config files and if they exist then edit them? They are just xml files.

Alex Reitbort
  • 13,504
  • 1
  • 40
  • 61
  • Hhmm I didn't think of that option. I was hoping there would be an API to do this with kind of like the AppSettings.Get, AppSettings.Set methods. I will try it though. Thanks. – armahg Feb 16 '09 at 18:03
  • ConfigurationManager.OpenExeConfiguration - http://msdn.microsoft.com/en-us/library/ms224437.aspx - this might help – Alex Reitbort Feb 16 '09 at 19:52