\

Facebook


วันจันทร์ที่ 6 กรกฎาคม พ.ศ. 2558

[Note] Error บน ASPX และ IIS

บทความนี้เก็บโน๊ต error ทั้งหมดที่ผมเคยเจอพร้อมวิธีแก้ น่าจะมีประโยชน์ครับถ้าเจอคล้ายๆกันและเอาไปปรับใช้กับ IIS จอมงอแง แตะนิดแตะหน่อยติดเออเรอตลอด


1. ตัวแรก Interop.MSXML2 โหลดไม่สำเร็จให้ลอง check app pool ดูว่าเป็นเวอร์ชั่นไหน ถ้ายังคงเป็น 2.0 ให้ลองเเก้เป็น 4.0 เเล้วรีสตาร์ทอีกครั้ง

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.


Parser Error Message: Could not load file or assembly 'Interop.MSXML2' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.



2. เวลาสร้าง table หรือ store procedure ใหม่แล้วเรียกใช้งานผ่าน ASP.NET execute store แสดง error : sql server invalid object name อาจเกิดจากการบันทึก cache ของตัง SQL Manager เองให้ลอง refresh ฐานข้อมูลก่อนจนกระทั้งเห็น Object ที่สร้าง แล้วเลือกคำสั่ง

Edit -> IntelliSense -> Refresh Local Cache  หรือ Ctrl + Shift + R

ตามรูป





3. เวลาใส่อักษรพอเศษเข้าไปก่อน POST REQUEST  เช่น $&#*(@&$*(#@&$*(#&$*(#&$*(#@&$)#(@$)#@*$)#@($*)(@

Server Error in '/' Application.

A potentially dangerous Request.Form value was detected from the client (ctl00$cpContent$txtCampaignID="$&#*(@&$*(#@&$*(#&$*(...").

Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$cpContent$txtCampaignID="$&#*(@&$*(#@&$*(#&$*(...").

Source Error:


[No relevant source lines]

Source File: c:\Users\ITspare03\AppData\Local\Temp\Temporary ASP.NET Files\root\9b6fe0e4\13708e62\App_Web_cwkso5lr.2.cs    Line: 


วิธีแก้ ให้เข้าไปเพิ่มบรรทัดนี้ใน system.web อย่าลืมตั้ง target framework เป็น 4
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <pages validateRequest="false" />
    <httpRuntime requestValidationMode="2.0" />
  </system.web>

May be like this posts