views:

402

answers:

1

Hello, 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

+1  A: 

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
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
ConfigurationManager.OpenExeConfiguration - http://msdn.microsoft.com/en-us/library/ms224437.aspx - this might help
Alex Reitbort