加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 如何将makepri.exe集成到MSBuild中?

发布时间:2020-12-16 01:52:22 所属栏目:百科 来源:网络整理
导读:我试图了解WinRT中的 Resource Management. 文件说: MakePRI.exe is a command line tool used for creating and dumping PRI files. It is integrated as part of MSBuild within Microsoft Visual Studio,but can be useful for developers to create pac
我试图了解WinRT中的 Resource Management.

文件说:

MakePRI.exe is a command line tool used for creating and dumping PRI files. It is integrated as part of MSBuild within Microsoft Visual Studio,but can be useful for developers to create packages by hand or by custom build systems.

我想知道如何将makepri.exe集成到MSBuild中,我该如何配置它?

解决方法

您的csproj文件为C#XAML应用程序导入此文件:

%ProgramFiles(x86)%MSBuildMicrosoftWindowsXamlv11.0Microsoft.Windows.UI.Xaml.CSharp.Targets

这反过来导入了以任何语言编写的Windows XAML应用程序常见的内容:

%ProgramFiles(x86)%MSBuildMicrosoftWindowsXamlv11.0Microsoft.Windows.UI.Xaml.Common.Targets

最后它导入包含makepri配置命令的文件:

%ProgramFiles(x86)%MSBuildMicrosoftVisualStudiov11.0AppxPackageMicrosoft.AppxPackage.Targets

在那里有一些叫做“_GenerateProjectPriFileDependsOn”的东西,它由以下任务组成:

_GeneratePrisForPortableLibraries;
        _GetPriFilesFromPayload;
        _ComputeInputPriFiles;
        _GenerateProjectPriConfigurationFiles;
        _CalculateInputsForGenerateProjectPriFileCore;
        _GenerateProjectPriFileCore;
        _AddFileReadsAndFileWritesForProjectPri;
        _CreateProjectPriFileItem;
        _ExpandPriFiles;

似乎它运行一些任务来列出资源,为makepri生成配置文件然后运行makepri.

目标文件有点神秘,需要分析,我会在这里查看这些makepri配置文件.如果您在应用项目的obj文件夹下搜索,则可以找到名为priconfig.xml的文件.事实上,如果你运行makepri.exe,你会发现有一个makepri命令用于创建配置文件,如果你尝试(通过运行makepri.exe createconfig) – 你会发现priconfig.xml是配置文件的通用名称.如果您运行“makepri new”,您将看到生成pri文件和调用语法的选项(“MakePri.exe new / pr / cf [options]”).现在,priconfig.xml文件列出了一些其他文件,如pri.resfiles,它们似乎列出了从引用的程序集导入的pri文件和layout.resfiles,它是应用程序中要打包的所有内容文件的列表.

所以这大致是如何将makepri集成到msbuild中的.现在,Windows开发人员中心在Resource Management System上有完整的主题,它描述了如果你想手动运行它,你将如何配置它.

您还可以在naming resources using qualifiers上阅读另一个相关主题,其中显示了如何获取以各种限定符(比例,区域设置等)命名的资源或位于限定符文件夹中的资源.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读