Add file to project without opening it in a window


  • Hello!

    I am writing an addin that generates classes. The classes are saved as files to the project file structure and added using the AddFromFile method. This works fine, but a new window is opened for each addition. As the number of classes generated are in the hundreds, the windows have to be closed. This is not a problem in itself, but it triples the running time of the addin and causes flickering in the UI.


    So how should I add new files to the project without opening a window? And if that is not possible, how could I turn off UI updates in Visual Studio while the addin is running?


    Any help appreciated!


    Best regards,

    Vemund Haga

    Tuesday, August 14, 2007 8:20 AM

All replies

  • Did you try to add the file using the AddFromTemplate method?

    Tuesday, August 14, 2007 2:30 PM
  • Hi Vemund,

    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Thank you!

    Monday, August 20, 2007 5:47 AM
  • Hi Feng,


    I have seen the same behaviour for managed package. that can be easily reproduced on IronPython sample. To do that:


    • Run IP sample from Visual Studio
    • Create new project
    • Create in Windows Explorer several files in newly created project root directory
    • Return back into Visual Studio and Add Existing Items to the project



    So the issue is not resolved. I undestand I should submit that on Microsft Connect but I just have no enough time now. Anybody, please do that if you do.



    Monday, August 20, 2007 7:50 AM

    That is not a big deal if I add some files with the source code - it is even convinient. But imagine the situation when I have a hundren files under the project I want to add. And half of them just can't be opened inside Visual Studio. There for example .doc, .xls, swf, some binary formats and so on. For each file system associated application will be opened. THAT IS ALREADY NOT SO GOOD...
    Monday, August 20, 2007 8:07 AM