How to publish C#.net window project using DTE object in C#.net RRS feed

  • Question

  • HI  Guys

    I am dveloping a project for automating build and publish process for my project in C#.net (Visual Studio 2008).

    I am able to build the project in release and Debug mode from code . but i am not able to publish it as i didn't find any method for this in DLL.

    so please guide to achieve this

    It very urgent ................... please

    Thanx in advance

    Dheeraj Kumar

    Friday, February 25, 2011 7:33 AM


All replies

  • Hi Fresher,

    Thanks for your post.

    I think you can try


    If I misunderstand your issue, be free to let me know.



    Best Regards,

    Ziwei Chen



    Ziwei Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Victor_Chen Friday, March 4, 2011 9:16 AM
    • Unmarked as answer by Victor_Chen Friday, April 8, 2011 8:55 AM
    Monday, February 28, 2011 7:58 AM
  • Hi Victor,

    Running the BUuild.PublishSelection brings up the publish to web popup.   The problem is how to now press the "Publish" button.  I have found for VS a SendKeys.SendWait(Enter) works if the popup has focus.   But  I cannot get this to work when MSbuild is invoking the automation process.

    What would be a better way to do this?



    Bert Swackhamer

    Tuesday, March 22, 2011 12:45 AM
  • The automation model (EnvDTE) provides:





    Another approach is to use the IVsPublishableProjectCfg interface of the SDK:


    which can be used also from an add-in. See:

    HOWTO: Get a Visual Studio service from an add-in

    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about developing add-ins: http://msmvps.com/blogs/carlosq/
    Tuesday, March 22, 2011 6:35 AM