使用Multilingual App Toolkit构建应用程序包

时间:2013-05-22 02:10:07

标签: msbuild multilingual

有一件奇怪的事情,当我使用Create App Packages向导在IDE中构建应用程序包时,多语言是正确的。

但是如果我在命令行中使用msbuild.exe构建它,例如:

msbuild.exe my.sln /t:rebuild /p:Configuration=Release;Platform=x86;Outdir=myoutput /flp:LogFile=my.log

结果应用包是错误的。它没有多语言资源,只有默认的英语。

IDE向导和msbuild.exe的不同之处是什么?我的命令行错了吗?

日志是:

    Target "AfterBuild" in project "myproject.csproj" (target "Build" depends on it):
Using "MultilingualBuild" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\Multilingual App Toolkit\v1.0\Microsoft.Multilingual.Build.dll".
Task "MultilingualBuild"
  Multilingual App Toolkit build started.
  Update build config xml started.
  Preprocessing XLIFF file: 'MultilingualResources\Chinese (Simplified).xlf'
  Preprocessing XLIFF file: 'MultilingualResources\Chinese (Traditional).xlf'
  Preprocessing XLIFF file: 'MultilingualResources\Italian (Italy).xlf'
  Preprocessing XLIFF file: 'MultilingualResources\Japanese (Japan).xlf'
  Preprocessing XLIFF file: 'MultilingualResources\Russian (Russia).xlf'
  Update build config xml completed.
  Generate latest XLIFF build task started.
  A translation unit with null or empty content was detected and ignored while generating the XLIFF file.
  A translation unit with null or empty content was detected and ignored while generating the XLIFF file.
  A translation unit with null or empty content was detected and ignored while generating the XLIFF file.
  A translation unit with null or empty content was detected and ignored while generating the XLIFF file.
  Latest XLIFF file generated: 'obj\x86\Release\MultilingualAppToolkitLatest.xlf'
  Generate latest XLIFF build task completed.
  Update XLIFF build started.
  TargetLang  ID: zh-Hans
  TargetLang XLiff: MultilingualResources\Chinese (Simplified).xlf
  XLIFF file updated: 'MultilingualResources\Chinese (Simplified).xlf'
  TargetLang  ID: zh-Hant
  TargetLang XLiff: MultilingualResources\Chinese (Traditional).xlf
  XLIFF file updated: 'MultilingualResources\Chinese (Traditional).xlf'
  TargetLang  ID: it-IT
  TargetLang XLiff: MultilingualResources\Italian (Italy).xlf
  XLIFF file updated: 'MultilingualResources\Italian (Italy).xlf'
  TargetLang  ID: ja-JP
  TargetLang XLiff: MultilingualResources\Japanese (Japan).xlf
  XLIFF file updated: 'MultilingualResources\Japanese (Japan).xlf'
  TargetLang  ID: ru-RU
  TargetLang XLiff: MultilingualResources\Russian (Russia).xlf
  XLIFF file updated: 'MultilingualResources\Russian (Russia).xlf'
  Update XLIFF build completed.
  Generate priInfo build started.
  Adding language 'zh-Hans' from 'MultilingualResources\Chinese (Simplified).xlf'
  Adding language 'zh-Hant' from 'MultilingualResources\Chinese (Traditional).xlf'
  Adding language 'it-IT' from 'MultilingualResources\Italian (Italy).xlf'
  Adding language 'ja-JP' from 'MultilingualResources\Japanese (Japan).xlf'
  Adding language 'ru-RU' from 'MultilingualResources\Russian (Russia).xlf'
  Generate priInfo build completed.
  Merge of Loc PRI file started.
  Copy App PRI file started.
  Copy App PRI file completed.
  C:\Program Files (x86)\Windows Kits\8.0\bin\x86\Makepri.exe resourcepack /o /pr "C:\hudsonprojects\myproject\sourcecode\myproject\myproject" /cf "obj\x86\Release\MultilingualAppToolkit.cfg.xml" /if "obj\x86\Release\MultilingualAppToolkit.pri" /of "../../../output/myproject/resources.pri"
  Update Manifest File Started.
  Update Manifest File added language id: 'zh-Hans'
  Update Manifest File added language id: 'zh-Hant'
  Update Manifest File added language id: 'it-IT'
  Update Manifest File added language id: 'ja-JP'
  Update Manifest File added language id: 'ru-RU'
  Update Manifest File is saving the manifest changes.
  Update Manifest File Completed.
  Merge of Loc PRI file completed.
  Multilingual App Toolkit build completed successfully.
Done executing task "MultilingualBuild".
Done building target "AfterBuild" in project "myproject.csproj".

2 个答案:

答案 0 :(得分:1)

尝试使用t:/ publish代替:

msbuild.exe my.sln /t:publish /p:Configuration=Release;Platform=x86;Outdir=myoutput /flp:LogFile=my.log

请参阅:http://social.msdn.microsoft.com/Forums/windowsapps/en-US/7522e6a3-1a74-42df-9414-bb93d745a0ca/why-msbuild-cannot-create-apppackage-

此外,虽然我没有在输出日志中看到它,但请确保在创建要发布的包之前排除Pseudo。 Pseudo是为本地化测试而创建的,它不会通过商店认证。

答案 1 :(得分:0)

如果没有更多信息,有点难以说明,Platform应该是AnyCPU而不是x86,这只取决于您的解决方案的配置方式。

您是否尝试过提高MSBuild输出详细程度以进行更详细的分析?

  

Visual Studio:工具>选项>项目和解决方案>构建并运行> ...

     

命令行:/ verbosity:详细

如果在尝试之后看不到差异,可能会使用更详细的日志输出更新您的问题。