简体   繁体   English

安装项目有不同的框架版本用于调试和发布?

[英]Setup project has different framework versions for debug and release?

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.将 VS2015 解决方案升级到 VS2019,其中包含 3 个项目:一个大型 vb.net 项目、一个非常小的 CSharp 项目和一个使用 Microsoft Visual Studio 安装程序项目扩展从早期 VS2015 项目移植过来的安装项目。

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.该解决方案成功编译并构建,但似乎该项目被构建了两次,结果 setup1.msi 的大小大约是迁移到 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.构建文件 'D:\\Local Git\\XXXX\\XX\\XXXX_GIT_Repository\\XXXXX\\Setup\\Setup1\\Release\\Setup1.msi'...两次,似乎所有引用都被复制了两次。

Solution configuration for解决方案配置

Debug (Any CPU) vb app-x86, c# app-Any cpu, Setup1 not included调试(任何 CPU) vb app-x86,c# app-Any cpu,不包括 Setup1

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

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在 Setup1.vdproj 中,我看到 Debug 设置为 .NETFramework,Version=v4.0,而在 Release 模式下它是 .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?有没有人知道为什么调试框架不同,以及如何使用 VS2019 IDE 将其设置为发布框架的框架?

I suspect that this maybe the cause of the duplicate messages and increased msi size.我怀疑这可能是导致重复消息和增加 msi 大小的原因。

"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麦克风

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?您确定双倍的大小不是由于 .msi 中同时包含 x86 和 x64 代码,因为在构建配置中指定了任何 CPU? To test this, go to Project Properties-->Compile, then see what's listed under "Target CPU".要对此进行测试,请转到“项目属性”-->“编译”,然后查看“目标 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.只选择x86,然后重建解决方案和安装包,安装MSI,看看C:\\Program Files(x86)中安装的程序文件夹中的.exe有多大,或者只看.exe的文件大小在 \\obj\\Release 或 \\bin\\Release 文件夹中,具体取决于您选择的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM