[ASP.NET] Vài vấn đề gặp phải khi dùng UrlRewritingNet

Hôm nay tui gặp phải lỗi khi dùng UrlRewritingNet

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 74:         {
Line 75:             string strLanguage = "";
Line 76:             if (HttpContext.Current.Session["lang"] != null)

 

Cách xử lý khá đơn giản, thêm dòng runAllManagedModulesForAllRequests=”true” vào ngay thẻ modules là xong.

Còn tại sao phải chèn runAllManagedModulesForAllRequests thì để nghiên cứu sau, giờ lo xử xong bug đã rồi tính tiếp 😀

Trả lời

Điền thông tin vào ô dưới đây hoặc nhấn vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Đăng xuất /  Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Đăng xuất /  Thay đổi )

Connecting to %s