从构建输出中省略本地化版本的程序集 [英] Omit localized versions of assemblies from the build output

查看:28
本文介绍了从构建输出中省略本地化版本的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个项目中,我使用了一个很棒的库,名为 Humanizer.这个库有多种语言变体(我数了 38 个).

In one of my projects, I am using an awesome library called Humanizer. This library comes in many language variations (I counted 38).

当我构建我的项目时,我会看到所有这些文件夹,如af"、ar"、bg"、bn-BD"、...、zh-Hant",其中包含包含本地化资源的程序集这个图书馆.

When I build my project, I then see all these folders like "af", "ar", "bg", "bn-BD", ..., "zh-Hant" with assemblies containing the localized resources for this library.

我的问题是我的项目只有英语,我对在我的构建输出中包含所有这些本地化程序集不感兴趣.有什么好的方法可以从构建中省略它们吗?

My issue is that my project is English-only and I have no interest in having all those localized assemblies in my build output. Is there some good way of omitting them from the build?

我正在寻找此问题的通用解决方案.它发生在 Humanizer 以外的库中,例如 DevExpress Controls 等,它们不是开源的.

I am looking for general solutions to this problem. It happens with libraries other than Humanizer, like DevExpress Controls etc., which are not open-source.

推荐答案

使用最新的 msbuild,您可以简单地将其放入您的 .csproj 文件中:

With the latest msbuild you can simply put this into your .csproj file:

<PropertyGroup>
  <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
</PropertyGroup>

参见 dotnet/sdk/issues/774

这篇关于从构建输出中省略本地化版本的程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆