The first accidental "System. Runtime. Serialization. dll" exception in System. Security. SecurityException

Source: Internet
Author: User

Today in the write cocos2d-x program, found this problem, press the START key to enter the background, or press the return key to return to the program. This exception is thrown. The thread is interrupted and the program cannot be returned.

The exception information is as follows:

The first accidental "System. Runtime. Serialization. dll" exception in System. Security. SecurityException
The first "mscorlib. dll" exception that occurs occasionally in System. Reflection. TargetInvocationException
The first accidental "System. Runtime. Serialization. dll" exception in System. Security. SecurityException
Thread '<No Name>' (0xec30092) has exited, and the returned value is 0 (0x0 ).
Thread '<No Name>' (0xe9d009a) has exited, and the returned value is 0 (0x0 ).
Thread '<No Name>' (0xfbf0072) exited. The returned value is 0 (0x0)

This is quite confusing. Suddenly, after the program enters the background, it cannot return.

After a great deal of effort, I finally figured out what caused the problem. It is because I saved a scenario reference in PhoneApplicationService, which is quite violent. Microsoft thinks it is insecure. This security exception is thrown ..

How can this problem be solved? Only the scenario saved by PhoneApplicationService on Deactivate is removed. However, I still need this value. I can only save it to IsolatedStorageSettings before removing it, And then retrieve the value from Actived and save it to PhoneApplicationService.

However, the same exception still exists. Because the IsolatedStorageSettings still does not meet the security requirements... But it can still achieve the goal .. The program can enter the background and return. What about other security ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.