在C#类项目,是做什么用的AssemblyCulture? [英] In a C# class project, what is AssemblyCulture used for?

查看:271
本文介绍了在C#类项目,是做什么用的AssemblyCulture?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#类项目中,有一个名为AssemblyInfo.cs中的属性文件。在这个文件是一系列组件的属性,包括 AssemblyTitle AssemblyDescription ,等等,这是用来形容某些有关编译的项目细节。其中之一是 AssemblyCulture

Within a C# class project, there's the Properties file called AssemblyInfo.cs. Within this file are a series of assembly attributes including AssemblyTitle, AssemblyDescription, and so on, which are used to describe certain details about the compiled project. One of these is AssemblyCulture.

据我所知,别人都用的东西,但什么是用来描述 AssemblyCulture 语言?货币?两者都有一点?

I understand what the others are used for, but What is AssemblyCulture used to describe? Language? Currency? A bit of both?

每当我看到这个属性,它是空白的。

Whenever I've seen this property, it's been left blank.

推荐答案

文档

的属性由编译器主组件和卫星组件之间进行区分。一个主要的程序集包含代码和中立的文化资源。卫星组装只包含资源为特定的文化,如 [汇编:AssemblyCultureAttribute(德)] 。把在装配这个属性和使用的区域性名称不是空字符串(),其他的东西会使本届大会看起来像一个卫星组装,而不是包含可执行代码的主要部件。标注一个传统的代码库,此属性将打破它,因为没有其他的代码将能够找到在运行时库的入口点。

The attribute is used by compilers to distinguish between a main assembly and a satellite assembly. A main assembly contains code and the neutral culture's resources. A satellite assembly contains only resources for a particular culture, as in [assembly:AssemblyCultureAttribute("de")]. Putting this attribute on an assembly and using something other than the empty string ("") for the culture name will make this assembly look like a satellite assembly, rather than a main assembly that contains executable code. Labeling a traditional code library with this attribute will break it, because no other code will be able to find the library's entry points at runtime.

总结:该属性是由框架在内部用来标记的附属程序集的时自动添加本地化资源到项目创建的。你可能永远需要手动设置该属性以外的任何其他

To summarize: This attribute is used internally by the framework to mark the satellite assemblies automatically created when you add localized resources to your project. You will probably never need to manually set this attribute to anything other than "".

这篇关于在C#类项目,是做什么用的AssemblyCulture?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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