Article : Deploying MFC applications via ClickOnce

Recently I had the task of deploying an MFC application suite along with its dependencies via ClickOnce. Visual Studio does not directly support deployment of MFC applications (even if it’s compiled with /clr) and one of the suggested solutions I found on the web was to have a stub C# executable which would launch the main MFC application. That way you could take advantage of Visual Studio’s built-in deployment functionality. My friend Rama Vavilala had a better suggestion for me – he asked me to try putting in a dummy cpp file into the main project that was compiled using /clr. If ClickOnce accepted such an executable as a .NET assembly, then all I would have to do would be to create the required manifest files on my own. Well all I can say is hats off to Rama for his elegant solution – because it actually did work. This article is a step-by-step pictorial on how you would deploy an MFC application using this trick.

Advertisements

5 thoughts on “Article : Deploying MFC applications via ClickOnce

  1. Can you explain better this sentence:
    “That’s it. You can try running the application via the ClickOnce URL and you’ll see that the app deploys and runs fine.”
    I’ve done all your steps (but I’m trying to deploy a WinForm App), but I can’t find the ClickOnce URL: if I click on “application”, I get the XML code…
    The .NET framework has to be installed before deploying?

  2. Can you enlighten me how can i change the mfc compilation setting to use /clr and remove its support for precompiled headers?

    Pardon me if my query is sensed idiocy.
    😦

  3. Hello,
    I read your article but I don’t understand your instructions.
    Step 1 – Add the dummy /clr file
    2nd line – You would also have to tweak a couple of other settings to allow the /clr compilation mode depending on your main project settings.
    I couldn’t understand what to do.
    Please help me.
    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s