Red Gate forums :: View topic - Crash after obfuscation : Security Rules Violated.
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Crash after obfuscation : Security Rules Violated.

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
UsherNet



Joined: 31 Mar 2011
Posts: 4

PostPosted: Thu Sep 29, 2011 3:00 am    Post subject: Crash after obfuscation : Security Rules Violated. Reply with quote

I experience an issue after running SA6, the exe works before the obfuscation. Anyone any ideas?

Inheritance security rules violated while overriding member: 'SmartAssembly.SmartExceptionsCore.SmartStackFrame.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

TIA

Paul
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Thu Sep 29, 2011 5:51 pm    Post subject: Reply with quote

Hi Paul,

I can't be 100% sure, but it sounds again like that problem you have when you used .NET 2 code access policy and tried to run it in .NET 4. There probably needs to be a SecurityTransparent attribute removed from some method. Have you got a stack trace leading up to this error?
Back to top
View user's profile Send private message
nkilian



Joined: 10 Dec 2009
Posts: 11
Location: South Africa

PostPosted: Tue Nov 08, 2011 1:15 pm    Post subject: Reply with quote

I am experiencing this same problem after upgrading an application to .NET 4.0. It runs fine before obfuscation, but in the obfuscated executable a TypeLoaderException is thrown with a SecurityException as the inner.

Decoded stack trace is:

at SmartAssembly.SmartExceptionsCore.StackFrameHelper.CreateExceptionN(Exception , Object[] )
at SmartAssembly.SmartExceptionsCore.StackFrameHelper.CreateException4(Exception , Object , Object , Object , Object )
at SmartAssembly.StringsEncoding.Strings..cctor()

Occurs with or without string encoding enabled.

Fake Edit:

Adding the following attribute to the Assembly resolved the issue:
<Assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)>
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group