1

有一件奇怪的事情,当我使用 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".
4

2 回答 2

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。伪是为本地化测试而创建的,它不会通过商店认证。

于 2013-07-26T15:57:07.867 回答
0

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

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

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

命令行:/详细:详细

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

于 2013-05-22T02:28:23.573 回答