Compiling unity 1.2 as .NET 4.0 Client Profile

Feb 12, 2010 at 7:04 AM


after I compile Unity 1.2 as .NET 4.0 Client Profile I got a SecurityException:

"Inheritance security rules violated while overriding member: "

The only way I found to solve this problem was setting "[assembly: SecurityRules(SecurityRuleSet.Level1)]" But I don't think this is an appropriate way...

Can someone explain me whats the right way to solve this problem ?

Many Thanks in Advance

Feb 12, 2010 at 8:04 AM

We haven't ported the Unity code to .NET 4.0 yet. If you get through this any other way, please let us know, it'd save me some time this month. :-)



Oct 19, 2011 at 2:25 PM

It seems that Unity 2.0 and 2.1 both aren't on .NET 4.0 nor .NET 4.0 Client Profile

Is there any reason why this hasn't been done by now?

PS: The Securitycritical attribute above the involved method should fix the security rule violated issue.


Oct 20, 2011 at 8:40 PM

Unity 2.0 and 2.1 are compiled against .NET 3.5. As such, they run binary-identical in .NET 4.0. Compiling for 4.0 would only prevent usage of the binary with other versions of the framework.

Why do you want a specifically .NET 4.0 binary for Unity?



Oct 20, 2011 at 10:48 PM

We're just trying to get all our dll's on .NET 4.0 Client Profile. Thru it doesn't really matter that much.

Nothing much to do with it either, but there are 2 differend GAC's, one for 2.0/3.5 and one for 4.0.