locked
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


    Fresher
    Friday, February 25, 2011 7:33 AM

Answers

All replies

  • Hi Fresher,

    Thanks for your post.

    I think you can try

    DTE.ExecuteCommand("Build.PublishSelection");

    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?

     

    Thank-you,

    Bert Swackhamer


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

    EnvDTE80.SolutionBuild2.Publish

    EnvDTE80.SolutionBuild2.PublishProject

    EnvDTE80.SolutionBuild2.PublishState

    EnvDTE80.Events2.PublishEvents

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

    http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivspublishableprojectcfg_methods%28VS.90%29.aspx

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

    HOWTO: Get a Visual Studio service from an add-in
    http://www.mztools.com/Articles/2007/MZ2007015.aspx


    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