TAILIEUCHUNG - ASP.NET 4 Unleased - p 79

Thêm một hội toàn cầu hội Cache Tất cả các hội đồng tạo nên NET thư viện. Lớp khung được chứa trong các hội Global Cache. Ví dụ, lớp ngẫu nhiên nằm ở việc lắp ráp , và lắp ráp được chứa trong các hội Global Cache. Bất kỳ lắp ráp đặt tại hội toàn cầu Cache có thể được tham chiếu bởi bất kỳ ứng dụng đang chạy trên một máy chủ. | 754 CHAPTER 17 Building Components Adding an Assembly to the Global Assembly Cache All the assemblies that make up the .NET Framework class library are contained in the Global Assembly Cache. For example the Random class is located in the assembly and the assembly is contained in the Global Assembly Cache. Any assembly located in the Global Assembly Cache can be referenced by any application running on a server. The Global Assembly Cache s physical location is at the following path C WINDOWS assembly Before you can add an assembly to the Global Assembly Cache you must add a strong name to the assembly. A strong name is similar to a GUID. You use a strong name to provide your assembly with a universally unique identifier. NOTE Technically a strong name consists of the name version number and culture of the assembly. The strong name also includes the public key from a public private key pair. Finally the strong name includes a hash of the assembly s contents so that you know whether the assembly has been modified. You can generate a strong name by using the command-line tool like this -k Executing this command creates a new file named which includes a new random public private key pair. WARNING Protect your key file. You should not reveal the private key to anyone. You can compile an assembly that includes a strong name by executing the Visual Basic .NET command-line compiler like this csc t library keyfile recurse .cs out The resulting assembly is strongly named with the public key from the file. The keyfile option associates the key file with the assembly. In this case the name of the resulting assembly is . An alternative method of associating a strong name with an assembly is to use the Assembly AssemblyKeyFile attribute. You can add this attribute to any of the source From the Library of Wow eBook Building Component Libraries 755 files that get compiled

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.