简体   繁体   中英

What is a private assembly in .Net?

I understand access modifiers at the class level and below, but why would an entire assembly be private? I assume by default, assemblies are public?

Well, in the context of assemblies, private means the assembly cannot be referenced by another application outside the directory it's contained in. Therefore, private to the application it's being used for.

As for your question about the default being public....someone correct me if I'm wrong, but there is no public. It would be shared. A shared assembly can obviously be referenced by multiple applications and must reside in the GAC. All the rules of the GAC would then apply.

The private in private assembly is not an access modifier. This is just a term used for assembles that are specific to one application - ie in this application's directory, as opposed to shared assemblies in the Global Assembly Cache.

私人组装是一个组件,特别是一个组件,在公共或共享时不能在应用程序之外引用,或者我们可以说它Global可以很容易地在组件外引用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM