Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (217.84 KB, 3 trang )
Steps to creating and using Shared Assembly
1.
• Tao Class Library project
• Lưu project
• Click Menu Project – Properties
• Click Signing
• Check on Sign the Assembly
• Click
• Chọn New
• Nhập tên tập tin chứa key
• Uncheck on “Protect my key file with
password”
• OK
• Build Project
2. Đăng ký Assembly với GAC và Registry
• Start - Microsoft Visual Studio 2005 - Visual Studio Tool - VS 2005 Command Prompt
• Chuyển vào folder Debug của DLL Project
• Nhập: GACUTIL /i <tên DLL> ví du: GACUTIL /i Myproject.dll
(Ba bước trên có thể thay thế bằng cách dùng Windows explorer drag chuột trên
file dll bỏ vào folder C:\Windows\assembly [dùng 2 cửa sổ windows explorer])
• Start – Run
• Nhập Regedit
• Click phải trên:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders
• Chọn New Key
• Nhấp kép trên muc defaut (khung bên phải)
• Nhập vào dường dẫn chứa tập tin dll trong thư mục assembly
Lưu ý:
Muốn biết file dll chứa trong folder nào của GAC ta dùng VS2005 Command promt
dùng lệnh
• cd \windows\assembly