How to add an existing file to a project in VS2008 Add-in?
Posted
by miliu
on Stack Overflow
See other posts from Stack Overflow
or by miliu
Published on 2010-05-05T18:55:26Z
Indexed on
2010/05/05
18:58 UTC
Read the original article
Hit count: 158
visual-studio-addins
|visual-studio
I'm trying to create an add-in for VS2008 to automate the unit tests. The test classes are located in a different project of the same solution. After the test class file is generated, I want to add it to that project automatically and make it active document. I could easily locate the test project, and I also found that testProject.DTE.ItemOperations.AddExistingItem(fileName)
can be used to add an existing item to a project. However, this call always adds the item to the current project, instead of the testProject. I'm sure there must be an easy way to do it, but I couldn't figure it out. Your help is much appreciated.
© Stack Overflow or respective owner