2016-04-10 16 views
5

tôi có các thiết lập sau đây trong tập tin web.config của tôi để xử lý các lỗi:Làm thế nào để Ngưng Azure IIS phụ Lỗi Tình trạng Mã Query String

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="500" /> 
    <error statusCode="500" responseMode="ExecuteURL" path="/error/internalservererror/" /> 
</httpErrors> 

Khi tôi ném một ngoại lệ trong ứng dụng của tôi nó hoạt động tốt tại địa phương nhưng nó chuyển hướng đến URL sau do lỗi trang trong xanh (lưu ý rằng trang này tôi ném ngoại lệ từ là ở phần cuối của URL:

https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/error/internalservererror/?500;https://example.com/about/

Làm cách nào để ngăn IIS thoát khỏi hành vi này trong Azure?

+0

Chỉ cần cố gắng cấu hình của bạn, nhưng không thể tái tạo hành vi này, cả hai đều hoạt động tốt khi chạy ở địa phương và xuất bản cho azure. Tôi tự hỏi liệu bạn có các quy tắc chuyển hướng khác trên IIS không? – forester123

Trả lời

1

Chỉ cần thêm một dấu chấm hỏi ở phần cuối của tham số đường dẫn của bạn, sử dụng mã của bạn, bạn sẽ có một cái gì đó như thế này:

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="500" /> 
    <error statusCode="500" responseMode="ExecuteURL" path="/error/internalservererror/?" /> 
</httpErrors> 
+0

Tôi không thể giải quyết vấn đề với câu trả lời này? Tôi đang sử dụng mẫu MVC 5 Boilerplate của Rehan. Bất kỳ đề xuất? – zbarrier

+0

Điều này không hoạt động. –

+0

logic đằng sau điều này là gì? btw nó không hoạt động. –

Các vấn đề liên quan