Error occurred during a cryptographic operation in debug

后端 未结 6 807
挽巷
挽巷 2021-01-01 16:20

I\'m getting the below error. This seems to have only started after I upgraded my visual studio 2015 to have the first update. I have read a few threads here about this be

6条回答
  •  借酒劲吻你
    2021-01-01 16:36

    added stack trace

    You didn't. Pretty important to understand why you get such a useless exception message. It is intentional. System.Web hides the real reason that the cryptographic code failed. You get a bland error message ("it did not work") and no stack trace of the actual code that failed.

    Important because not doing so is dangerous, it allows an attacker to probe your web app with intentionally malformed data and gain knowledge from the exceptions to find a way to crack your secure code.

    You need to get a better stack trace and exception message to find the real reason. That requires you to tell the debugger to stop when the exception is thrown. The real one, not the bland one. In VS2015, use Debug > Windows > Exception Settings. Click the "Common Language Runtime Exceptions" checkbox so it turns from a rectangle to a check-mark. Also: Tools > Options > Debugging > General > untick the "Enable Just My Code" checkbox.

提交回复
热议问题