我正在使用Visual Studio MSIX打包项目在网络共享上为内部应用程序创建安装程序。
一个问题是,它创建的目录在末尾带有"_Test“。
它为什么要这样做,我如何摆脱它?我只想要"MyApp.MSIX_0.0.1.0",或者理想情况下是"MyApp.0.0.1.0“。
Directory of I:\
08/14/2020 09:44 AM <DIR> .
08/14/2020 09:44 AM <DIR> ..
08/14/2020 09:44 AM 21,312 index.html
08/14/2020 09:23 AM 601 MyApp.MSIX.appinstaller
08/14/2020 09:37 AM <DIR> MyApp.MSIX_0.0.1.0_Test
2 File(s) 21,913 bytes
3 Dir(s) 62,444,621,824 bytes free我一直在搜索文档,但我找不到任何关于它创建的目录或它生成的index.html文件的内容。我想要自定义所有这些,添加版本说明等。
这是一个WPF应用程序,如果这有什么不同的话。
发布于 2020-09-02 15:44:34
我只是在这里放了一份
包的输出目录在C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage的Microsoft.AppxPackage.Targets文件中定义(取决于您的Visual Studio版本)。
如果您想删除"_Test“后缀,您可以修改定义输出目录的行。在我的文件中,它大约在第3190 -3196行:

要修改输出的html文件,请修改“Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Landing”子目录中的index.template.html文件- C:\Program Files (x86)\Microsoft Visual html(取决于VS版本)。
发布于 2021-06-23 21:27:19
如果您正在使用Azure Pipeline进行部署,则可以向MSBuild任务添加参数以执行此操作。例如:
硬编码:
task: MSBuild@1
displayName: MSBuild
inputs:
solution: '**/*.sln'
platform: 'x64'
configuration: 'Release'
msbuildArguments: '/p:OutDir=$(Build.BinariesDirectory)/
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/MyApp_1.0.0/"'或者使用管道变量:
msbuildArguments:
/p:OutDir=$(Build.BinariesDirectory)/
/p:AppxPackageTestDir="$(Build.BinariesDirectory)/MyApp.Installer/AppPackages/$(packageName)_$(newVersion)/"这给出了一个名为"MyApp_1.0.0“的文件夹,而不是令人困惑的"MyApp_1.0.0_Test”。
并且.appinstaller文件中的Uri属性将正确地指向此文件夹。
https://stackoverflow.com/questions/63508078
复制相似问题