Thứ Ba, 21 tháng 11, 2023

[ASP.NET] Could not load file or assembly '*******' or one of its dependencies. An attempt was made to load a program with an incorrect format.

 Lỗi có dạng thông báo như sau :

Could not load file or assembly '*******' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Nguyên nhân là do Source khi build có kèm theo dll (copy local=true) mà bản runtime này đã có được setup trên máy chủ. do đó hệ thống load cùng lúc 2 DLL dẫn tới lỗi.

Để khắc phục lỗi này thì hoặc remove bản runtime setup trên server hoặc đơn giản là xóa các dll liên quan trong thư mục bin của source đi là được







Thứ Năm, 21 tháng 9, 2023

[MSSQL] Lỗi không start được sau khi update

 Sau khi update SQL mà bị lỗi không start lại được dịch vụ, kiểm tra log SQL có báo lỗi liên quan đến database master 


Script level upgrade for database 'master' failed because upgrade step 'u_tables.sql' encountered error 25641, state 0, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.


Để start lại được SQL thì càn thêm biến /T902 để khi start SQL sẽ bỏ qua script update

    net start mssql$instancename /T902

Hoặc khai báo tham số này trong SQL Configuration Manager