Chủ Nhật, 16 tháng 2, 2025

Lỗi netload trong AutoCAD với file dll tải từ trên mạng | Cannot load assembly in AutoCAD | AutoCAD dotNet

Ứng dụng được phát triển/Sưu tầm bởi đội ngũ AutoLISP Thật là đơn giản
   

Thông tin thêm: 👉👉👉

LỖI NETLOAD TRONG AUTOCAD VỚI FILE DLL TẢI TỪ TRÊN MẠNG 🚫💻

NGUYÊN NHÂN 🔍

Khi sử dụng NETLOAD trong AutoCAD để tải một file DLL được tải từ trên mạng, bạn có thể gặp phải lỗi không cho phép nạp file, kèm theo các thông báo như:

"Cannot load assembly"
"File is blocked"

Nguyên nhân chủ yếu là do Windows hoặc Windows Defender tự động chặn các file tải về từ internet để đảm bảo an toàn.

Thông báo lỗi:
Command: NETLOAD  
Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or  
assembly 'file:///E:\2.LIPSCAD\3.LISP CAD\***************.dll' or one of its dependencies.  
Operation is not supported. (Exception from HRESULT: 0x80131515)  
File name: 'file:///E:\2.LIPSCAD\3.LISP CAD\***************.dll' --->  
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName) at loadmgd()


GIẢI PHÁP ✅

Để khắc phục lỗi này, bạn có thể làm như sau:

1️⃣ Mở thư mục chứa file DLL
2️⃣ Click chuột phải vào file DLL 🔽
3️⃣ Chọn Properties (Thuộc tính)
4️⃣ Ở tab General, kéo xuống dưới cùng
5️⃣ Nếu có tùy chọn Unblock (Bỏ chặn), hãy tích vào ô này
6️⃣ Nhấn OK hoặc Apply để lưu thay đổi

Sau đó, thử NETLOAD lại trong AutoCAD! 🚀



👉 Lưu ý: Nếu không thấy tùy chọn Unblock, có thể file của bạn không bị chặn hoặc chính sách bảo mật của hệ thống đã vô hiệu hóa tính năng này. Bạn có thể thử di chuyển file đến một thư mục khác hoặc tắt Windows Defender tạm thời rồi thử lại.

Chúc bạn thành công! 💪


Tham gia nhóm Lập trình AutoCAD dotNet

Link tham gia: http://dnz.lisp.vn



---------------------------------------------------------------------------------------------
Ứng dụng được phát triển bởi đội ngũ AutoLISP Thật là đơn giản - Tác giả ứng dụng in D2P

    

Mọi thông tin xin liên hệ Fanpage AutoLISP Thật là đơn giản!
Cảm ơn bạn đã theo dõi!

Không có nhận xét nào:

Đăng nhận xét

Tính diện tích trắc ngang siêu tốc | Áp dụng ứng dụng AALL.VLX tính diện tích, chiều dài | AutoLISP Reviewer

Ứng dụng được phát triển/Sưu tầm bởi đội ngũ AutoLISP Thật là đơn giản     Thông tin thêm: 👉👉👉