How can I add existing item in solution explorer programmatically (i.e., at run time) in a Visual studio 2010 project ?
existing items may include images,videos etc
How can I add existing item in solution explorer programmatically (i.e., at run time) in a Visual studio 2010 project ?
existing items may include images,videos etc
You'll likely end up using Visual Studio's existing automation framework for this, or something that wraps it.
In particular, once you get a reference to the project, you'll access its ProjectItems property to get the collection of items in the project, and then use either AddFromFile or AddFromFileCopy depending on whether you want to add the original at its existing location or a copy to be placed within the project dir.
the DTE object is kind of the 'root' of the automation object model - for more info, see http://msdn.microsoft.com/en-us/library/t6d9sf9k.aspx