1

我想建立一个 *. appxbundle用于包含x86 AND x64 appx 的 Windows 8.1 JavaScript 应用程序。

这在 Visual Studio 2013 上运行良好。我右键单击项目并选择Store -> Create app packages,然后选择两种架构。

但是我无法让它在 MSBuild 上运行。我的 msbuild 语句如下所示:

msbuild MyProj.Win81.jsproj /property:Configuration=Release;Platform=x64;AppxBundle=Always /target:Clean,Rebuild,Publish

我的MyProj.Win81.jsproj看起来像这样(缩短了一点):

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ProjectConfiguration Include="Debug|AnyCPU">
  <Configuration>Debug</Configuration>
  <Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
  <Configuration>Debug</Configuration>
  <Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
  <Configuration>Debug</Configuration>
  <Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
  <Configuration>Debug</Configuration>
  <Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
  <Configuration>Release</Configuration>
  <Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
  <Configuration>Release</Configuration>
  <Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
  <Configuration>Release</Configuration>
  <Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
  <Configuration>Release</Configuration>
  <Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
  <Import Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0'">
    <VisualStudioVersion>12.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
  <PropertyGroup>
    <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
    <TargetPlatformVersion>8.1</TargetPlatformVersion>
    <RequiredPlatformVersion>8.1</RequiredPlatformVersion>
    <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
    <DefaultLanguage>en-US</DefaultLanguage>
    <AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
    <AppxBundle>Always</AppxBundle>
    <AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
  </PropertyGroup>

  <ItemGroup>
    <AppxManifest Include="package.win81.store.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
</Project>

MSBuild 将始终生成仅包含 x64 体系结构的 appxbundle。这可能是因为我明确设置了 Platform=x64,尽管 AppxBundlePlatforms 定义了两者。如果我忽略 Platform 参数,我会遇到错误:

error APPX3104: You cannot create an app bundle when building for platform 'AnyCPU' which is not included in the list of platforms selected for producting app bundle. Set platform to a one of following values: x86;x64.

我错过了什么?

//编辑:这里是VS2013 appxbundle创建和jsproj文件更新项目配置的截图 在此处输入图像描述

4

0 回答 0