Can ClickOnce install .Net Framework 3.5SP1 First before other prerequisites?

Richard Arnold 181 Reputation points
2021-01-19T21:12:11.747+00:00

I have a C# 4.0 WinForms application, which uses ClickOnce to deploy. I have chosen to 'Download prerequisites from the same location as my application'.

I have selected .NET Framework 3.5 SP1 to be installed, if the end-user's system does not have it installed.

I am also installing SQL Server 2012 Express.

The problem I'm experiencing is 2-fold.

  1. When I attempt to run the setup program on a new computer with Windows 10, the setup program appears to try installing SQL Server first, before attempting .NET Framework 3.5 SP1, and the install then fails.

Only then does a dialog appear, prompting to install .NET Framework 3.5 SP1, which it downloads.
NOTE: I have the complete set of files for .Net 3.5SP1, as shown in the following path:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\DotNetFX35SP1

2) ClickOnce does not use the included setup files to install .NET Framework 3.5 SP1, but wants to download it.

I do not want the end-user to experience a failed install because .Net 3.5SP1 doesn't install first.

My question is this. How can I have the ClickOnce deployment package install .Net 3.5 SP1 BEFORE any other prerequisites?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,857 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,131 questions
0 comments No comments
{count} votes

Accepted answer
  1. Daniel Zhang-MSFT 9,621 Reputation points
    2021-01-20T06:10:59.473+00:00

    Hi RichardArnold-1221,
    The error occurs because .NET Frameworks 3.5 SP1 package only support Homesite. Only supports"Install Prerequisites from Component Vendor's Website".
    Pertinent infomation from section 2.3.1.1 of the VS2008SP1Readme:
    If the .NET Framework 3.5 SP1 bootstrapper package is selected in the Prerequisite dialog box for a Setup project or in ClickOnce publishing, and also the "Download prerequisites from the same location as my application" option is selected, the following build error is shown:
    The install location for prerequisites has not been set to 'component vendor's web site' and the file 'dotNetFx35setup.exe' in item 'Microsoft.Net.Framework.3.5.SP1' cannot be located on disk.

    To resolve this issue, there are some detailed solutions in the following threads you can refer to.
    Visual studio 2010 setup project problem
    VS2008 SP1 - Selecting .NET 3.5 SP1 prerequisite in setup project causes build error
    Best Regards,
    Daniel Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Richard Arnold 181 Reputation points
    2021-01-21T21:21:45.663+00:00

    Hello @DanielZhang
    This is good information. I now understand from your explanation why .Net 3.5SP1 was failing.

    I removed sql server files, and unchecked the .Net3.5sp1 under 'Turn Windows features on or off', and rebooted.
    I followed the link provided, changed my product.xml file as outlined, recompiled my App and tried installing it again.

    The only problem I ran into was that, although .Net 3.5SP1 was successfully installed (and the resulting log file confirmed this), SQL Server again balked and the install failed, stating the following: "Component SQL Server 2012 Express has failed to install with the following error message:

    "The system cannot find the path specified. " The following components were successfully installed: - .NET Framework 3.5 SP1
    The following components failed to install: - SQL Server 2012 Express".

    In reading the error log, near the end of the log, it stated: "Status of package '.NET Framework 3.5 SP1' after install is 'InstallSucceeded'
    Status of package 'SQL Server 2012 Express' after install is 'InstallFailed'

    However, I believe that the install was unable to read the registry values, which did show .Net as installed with a value of "1" under SP.

    Therefore, I rebooted the computer and ran setup.exe again. This time the install was successful! Just an FYI.

    0 comments No comments