What Replaces Code Access Security in .net
With the demise of Code Access Security, how do we restrict access to a DLL in .Net framework 4.0?
Specifically, we have a project with a UI laye开发者_如何转开发r and a business layer. The UI layer tells the business layer who the user is.
What we are trying to stop is any dll other than the UI layer calling the business layer and saying "Hi I am Joe".
Somewhat a partial answer, but you can use the lagacy CAS in .Net 4. Quote from http://www.infoq.com/news/2009/11/CAS-Replaced:
With .NET 4.0, global CAS policies will disabled by default. System administrators are encouraged to use more effective means such as Windows Software Restriction Policies instead. If CAS is actually needed, it can be enabled on a per application basis in the app.config file setting the runtime/NetFx40_LegacySecurityPolicyenabled flag to true.
Here's a brief summary on what's been changed and what's been introduced to replace it, as well as how to implement the new features.
Hope it's of some help :
CAS Migration
精彩评论