\

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

  • สร้าง WebApp ด้วย VueJS บน Digital Ocean ตอนที่ 3 : ติดตั้ง MongoDB บน Debian 8
    19/05/2018 - 0 Comments
    อย่างที่เกริ่นไปก่อนว่าผมใช้ database เป็น NoSQL ซึ่งผมใช้ MondgoDB มาเป็นตัวจัดการฐานข้อมูล…
  • Tip : เล็กๆกับการ Commit SVN
    25/04/2013 - 0 Comments
    Trick เล็กๆน้อยกับการใช้งาน เต่า SVN : จริงๆแล้วการแก้ไข “ไฟล์เดียวกัน”…
  • [Android] Stream เสียงจาก PC บน Network ด้วย SoundWire
    23/03/2015 - 0 Comments
    ใครเคยมีประสบการณ์ จู่ๆลำโพง  Notebook ก็งอแง"เสียงแตก"ไปเฉยๆ…
  • เรื่องของ MyComputer ที่อาจยังไม่รู้
    16/05/2013 - 0 Comments
    ตอน uninstall โปรแกรมเข้ากันยังไงครับ ยังเป็นแบบนี้อยู่หรือเปล่า Start > Control Panel > Program and…
  • อัพเดตโค๊ด Revisionล่าสุดมาMerge >> แล้วโค๊ดอะไรเปลี่ยนแปลงบ้าง
    27/08/2013 - 0 Comments
    การใช้งาน Revision Control ในโปรเจกค์เขียนโปรแกรมที่มีขนาดใหญ่ถือว่าจำเป็นมาก…
  • ไม่แปลกใจเลยกับเว็บรัฐบาล SQL Injection กับกรมสรรพกร
    11/01/2017 - 0 Comments
    แค่เข้าไปค้นหาโรงเรียนที่อยู่ในรายชื่อบริจาคแล้วได้สิทธิลดหย่อน…
  • ระบบ LogIn ใน Windows Form Application
    04/04/2013 - 0 Comments
    ระบบ LogIn ใน Windows Form Application ซึ่งผมได้สร้างข้อมูลใน Table “Users” ไว้แล้ว…