Home > Back-end >  Setup project has different framework versions for debug and release?
Setup project has different framework versions for debug and release?

Time:11-27

Have a VS2015 solution upgraded to VS2019 with 3 projects: a large vb.net project, a very small CSharp project and a setup project ported over from the earlier VS2015 project using the Microsoft Visual Studio Installer Project extension.

The solution compiles and builds successfully but it appears the project is being built twice and the resulting setup1.msi is roughly double the size of that built before the move to VS2019.

The output window shows the line -

Building file 'D:\Local Git\XXXX\XX\XXXX_GIT_Repository\XXXXX\Setup\Setup1\Release\Setup1.msi'... twice and it seems that all references are being copied twice.

Solution configuration for

Debug (Any CPU) vb app-x86, c# app-Any cpu, Setup1 not included

Release(Any CPU) vb app-x86, c# app-Any cpu, Setup1 included

In the Setup1.vdproj I see that Debug is set to .NETFramework,Version=v4.0, while in Release mode it is .NETFramework,Version=v4.6.1

Is anyone aware why the debug framework is different and how to set it to that of the release Framework using the VS2019 IDE?

I suspect that this maybe the cause of the duplicate messages and increased msi size.

"Debug"
    {
    "DisplayName" = "8:Debug"
    "IsDebugOnly" = "11:TRUE"
    "IsReleaseOnly" = "11:FALSE"
    "OutputFilename" = "8:Debug\\Setup1.msi"
    "PackageFilesAs" = "3:2"
    "PackageFileSize" = "3:-2147483648"
    "CabType" = "3:1"
    "Compression" = "3:2"
    "SignOutput" = "11:FALSE"
    "CertificateFile" = "8:"
    "PrivateKeyFile" = "8:"
    "TimeStampServer" = "8:"
    "InstallerBootstrapper" = "3:2"
        "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
        {
        "Enabled" = "11:TRUE"
        "PromptEnabled" = "11:TRUE"
        "PrerequisitesLocation" = "2:1"
        "Url" = "8:"
        "ComponentsUrl" = "8:"
            "Items"
            {
                "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0"
                {
                "Name" = "8:Microsoft .NET Framework 4 (x86 and x64)"
                "ProductCode" = "8:.NETFramework,Version=v4.0"
                }
            }
        }
    }
    "Release"
    {
    "DisplayName" = "8:Release"
    "IsDebugOnly" = "11:FALSE"
    "IsReleaseOnly" = "11:TRUE"
    "OutputFilename" = "8:Release\\Setup1.msi"
    "PackageFilesAs" = "3:2"
    "PackageFileSize" = "3:-2147483648"
    "CabType" = "3:1"
    "Compression" = "3:2"
    "SignOutput" = "11:FALSE"
    "CertificateFile" = "8:"
    "PrivateKeyFile" = "8:"
    "TimeStampServer" = "8:"
    "InstallerBootstrapper" = "3:2"
        "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
        {
        "Enabled" = "11:TRUE"
        "PromptEnabled" = "11:TRUE"
        "PrerequisitesLocation" = "2:1"
        "Url" = "8:"
        "ComponentsUrl" = "8:"
            "Items"
            {
                "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.6.1"
                {
                "Name" = "8:Microsoft .NET Framework 4.6.1 (x86 and x64)"
                "ProductCode" = "8:.NETFramework,Version=v4.6.1"
                }

Thanks so much for reading.

Mike

CodePudding user response:

Are you sure the doubled size is not due to having both x86 and x64 code inside the .msi because Any CPU is specified in the build configuration?

To test this, go to Project Properties->Compile, then see what's listed under "Target CPU". Select x86 only, then rebuild the solution and setup package, install the MSI, and see how large the .exe is in the installed program folder in C:\Program Files(x86), or just look at the file size of the .exe in either \obj\Release or \bin\Release folder, depending on which target you have selected.

  • Related