1.add two compile instruction;
2.restart unity project
System.Security.Permissions.SecurityPermissionAttribute is obsolete:
CAS support is not available with Silverlight applications
System.Security.Permissions.SecurityAction is obsolete:
CAS support is not available with Silverlight applications.
4.if only add any one compile instruction,unity can’t report anything error.
Well, you haven’t said what’s your targetplatform. It’s generally not recommended to use unsafe code however on some platforms it’s not supported at all.
Furthermore you use
-warnaserror so every warning that a compiler would raise is interpreted as error. Errors will make the compilation fail on purpose.
So under the line you probably use some code that uses the “SecurityPermissionAttribute” on some class. This attribute is marked as obsolete and will cause a warning when used. Since you use
-warnaserror that error will cause the compiler error.
You haven’t given enough information on your problem. If you want more information you should tell us:
- your target platform
- Why you actually want to use unsafe code
- if you use any additional thirdparty frameworks / libraries
2.use protobuf-net library ,contains unsafe code.
3.create a new empty,add two compile instruction; -unsafe -warnaserror,unity reports the same as error.