I'm trying to write my first add-in for vs2010, but im struggling.
I have a assembly that generates lots of cs files. I want my plugin to add new files to the select project or if the files exist, overwrite them.
I'm having 2 problems:
- When I add a new file, how do I add it to a sub folder inside the project? I seem to only be able to add to the root of the project.
- If a cs file exists, how do I clear its content? Im using the EnvDTE.TextDocument & EnvDTE.EditPoint interfaces. But every time I try and iterate through the document clearing lines, I get a COM error "Exception from HRESULT: 0x80041001".
I dont want to delete the file and add a new file if I can help it. Due to the logging on source control.