none
How do I create a project that consists of three separate projects:C++ console application, WPF, and Windows Service in VB.net RRS feed

  • Question

  • I have VS 2012 running .NET 4.5.  I have these things working separately.  How do I make it so that the Windows Service launches the WPF via quick icon on the taskbar and that the console application is always hidden and always running when the Windows Service is running?
    Friday, March 1, 2013 11:16 PM

Answers

  • Hi There,

    Welcome to the MSDN Forum.

    You can just add these type of project to the same solution, and here is a how-to document for your reference: http://msdn.microsoft.com/en-us/library/h970wzkb.aspx  

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 4, 2013 8:26 AM
    Moderator
  • FYI you cannot start a WPF app from a Windows service.  Services have no UI and run (Vista+) in session 0 where they cannot access the user's desktop - if there is even a user logged on.  The general solution for associating a UI with a service is to add the UI app as a startup program when the user logs in (via registry or Start Menu folder).

    A console app that is always hidden and always running is really nothing more than a service so it sounds like you'd have 2 services although I'm not sure why you wouldn't just merge the services into one.

    Michael Taylor - 3/7/2013
    http://msmvps.com/blogs/p3net

    Thursday, March 7, 2013 11:45 PM
    Moderator

All replies

  • Hi There,

    Welcome to the MSDN Forum.

    You can just add these type of project to the same solution, and here is a how-to document for your reference: http://msdn.microsoft.com/en-us/library/h970wzkb.aspx  

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 4, 2013 8:26 AM
    Moderator
  • That answers the first part.  Thanks Mike.  Can you also tell me how I would communicate between projects ie how would i make the console app run on a windows service.  And how would I add a quick icon in the taskbar that would launch a wpf
    Monday, March 4, 2013 5:48 PM
  • If I were to implement one-click deployment that works with wpf.  But if a if a console app is included in the same solution how would i deploy that within the wpf one-click deployment. 
    Thursday, March 7, 2013 10:09 PM
  • FYI you cannot start a WPF app from a Windows service.  Services have no UI and run (Vista+) in session 0 where they cannot access the user's desktop - if there is even a user logged on.  The general solution for associating a UI with a service is to add the UI app as a startup program when the user logs in (via registry or Start Menu folder).

    A console app that is always hidden and always running is really nothing more than a service so it sounds like you'd have 2 services although I'm not sure why you wouldn't just merge the services into one.

    Michael Taylor - 3/7/2013
    http://msmvps.com/blogs/p3net

    Thursday, March 7, 2013 11:45 PM
    Moderator
  • is your console app = wpf app?

    if it is, and you want it be to hidden, why the need of console/wpf app?

    you probably can just run your process (which have no ui need at all) in your win service.

    probably just convert those console/wpf app into dll, then execute from your win svc.

    Friday, March 8, 2013 6:40 AM